Merv-Local + TestNG guide

Introduction

TestNG is a popular Java test framework for suites and parallel runs. Merv-Local integrates via MervTestNGHandler as a TestNG listener and writes reports under merv.report.folder.

You will learn
  • How to add merv-client-api to Maven
  • Minimum merv.properties for local mode
  • How to register the TestNG listener in testng.xml
  • Optional Selenium binding for screenshots
  • How to record data, validation, and info steps

Add dependency

Add MERV to your project (use the latest version from Maven Central when available):

<dependency>
  <groupId>io.github.techelliptica</groupId>
  <artifactId>merv-client-api</artifactId>
  <version>3.0.3</version>
</dependency>

Configure merv.properties

Place merv.properties on the classpath (for example src/test/resources/):

merv.local=true
merv.regression_suite=Your Regression Suite Name
merv.report.folder=./merv-reports
merv.execution.parallel=false
merv.screenshot=on

Register TestNG listener

Add the listener class to your testng.xml:

<listeners>
  <listener class-name="org.teche.merv.client.plugin.MervTestNGHandler" />
</listeners>

If you run TestNG via Surefire, make sure the correct testng.xml is picked up.

Bind automation (optional)

When merv.screenshot=on, bind your driver in your base test / setup:

// Selenium example
MervTestNGHandler.setAutomationToolObject(AutomationTool.SELENIUM, driver);

Plugin steps in tests

Use the unified reporter API (same for Cucumber, TestNG, and JUnit 5):

MervReporter.validation("Verify total", expected, actual);
MervReporter.data("Payload", requestJson);
MervReporter.info("Reached checkout page");

Run tests

mvn test

Viewing Merv reports

After a run, reports live under {merv.report.folder} (for example ./merv-reports/). Open paths through a local web server — not via file:// in the file manager.

merv-reports/ index.html # Dashboard (all runs) 15-05-2026 14-23-41 Merv-Report/ json/merv-report.json # Suite + testcase data html/merv-report.html # Final suite report html/merv-report-live.html # Live report during run

Open with a web server

Merv-Local reports load JSON and charts with fetch. Browsers often block that on file:// URLs. Use your IDE’s static server (or any local HTTP server) so the address bar shows http://localhost:….

  1. In VS Code, install Live Server, right-click merv-reports/index.html, and choose Open with Live Server.
  2. In IntelliJ IDEA, right-click index.html and choose Open in Browser (built-in preview server).
  3. While tests run, keep merv-report-live.html open on the same server for live updates.

What’s next

← Back to Documentation