Free tools Windows power users keep installed
One-click scans. No signup required.
To add a message to a TestNG HTML report from a Selenium test, import org.testng.Reporter and call Reporter.log("message"); from the test flow. For example, log a useful milestone after opening a page or submitting a form. The message is report output—not an assertion, a browser setup step, or a replacement for application logging.
Write a Reporter message in a Selenium test
TestNG documents Reporter.log for messages that should appear in generated HTML reports. A minimal example is:
As an Amazon Associate I earn from qualifying purchases.
import org.testng.Reporter;
import org.testng.annotations.Test;
public class SearchTest {
@Test
public void searchShowsExpectedResults() {
Reporter.log("Opened the search page");
// Run the existing Selenium actions and assertions here.
Reporter.log("Submitted the search and checked the results");
}
}
This example assumes the project already has a working WebDriver setup and runs the method under TestNG. Reporter does not create or configure a browser. Add messages at meaningful points in the test flow, and use assertions to verify expected browser states: a log entry alone does not establish that a page or result was correct. TestNG’s documented example is Reporter.log("M3 WAS CALLED");. TestNG: Logging and results.
Keep messages useful and safe
- Prefer concise milestones or outcomes, such as “Search form submitted” or “Results heading was visible.”
- Do not log credentials, tokens, personal data, or other secrets; report files may be retained or shared.
- Do not mistake Reporter messages for application logs or TestNG’s own internal logging.
Find the generated report
TestNG says the run’s index.html is in the output directory selected when launching SuiteRunner; it links to other HTML and text result files. Check the directory configured by the runner or build, then open the generated HTML report. The exact paths and layout can differ with Maven, Gradle, an IDE, or a custom reporter, so do not assume every setup writes to the same location. TestNG: Logging and results.
Choose the right TestNG output mechanism
| Need | Mechanism | When to use it |
|---|---|---|
| Add explanatory text to a test’s generated HTML report | Reporter.log(...) |
Use it for messages associated with the test flow. |
| React as tests start, pass, fail, or skip | ITestListener |
TestNG describes listeners as real-time notifications of test events. |
| Build a report after all suites finish | IReporter |
TestNG invokes generateReport(List<ISuite> suites, String outputDirectory) after the suites run. |
| Export structured TestNG-specific result details | Built-in or custom XML reporting | TestNG documents XML options including groups, result attributes, stack-trace output, and report fragmentation. |
See the TestNG reporting documentation and TestNG listener interface index for the relevant APIs.
Troubleshoot missing messages
- The test did not run under TestNG: confirm the test is being executed by the TestNG runner and that the method ran, rather than assuming the IDE or another test framework will collect its output.
- You are checking the console only: Reporter messages are intended for generated HTML reports. Locate the actual output directory selected by the runner and inspect its HTML report.
- The report is customized or replaced: report listeners and plugins can affect output layout. Check the project’s configured listeners and reporter settings instead of assuming the default file arrangement.
- The project uses an unexpected TestNG dependency: check the version resolved by the build. The official download page lists TestNG 7.9.0 as current and was last updated 2026-08-31; your project may use another version. TestNG download page.
TestNG versions, logging, and third-party reports
TestNG’s logging documentation says that since version 7.5 it has used SLF4J as its logging facade and does not bundle an explicit SLF4J implementation by default. That concerns TestNG’s internal logging integration; it is separate from adding test messages with Reporter.log. Check the dependency resolved by your build before applying version-specific setup. Logging and results; Download.
Rank #2
ReportNG is a third-party HTML/XML reporting plugin described as a replacement for TestNG’s default HTML report. Its project page lists version 1.2.2 and says it was tested with TestNG 6.14.3; those details do not establish compatibility with every current TestNG or Selenium setup. The page outlines listener registration and an option to disable TestNG’s default listeners. Validate any plugin against the versions and runner in your own project. ReportNG project page.
Or skip the browser setup
For a screenshot without writing or maintaining Selenium browser setup, ScreenshotNeo offers a one-call API. This is separate from TestNG Reporter output: it returns a screenshot or PDF rather than adding a message to a TestNG report. See the ScreenshotNeo API documentation.
Quick Recap
Best Value
Rank #4
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots per month with no card, and paid plans start at $5 for 3,000. Learn about ScreenshotNeo, or sign up for 1,000 free screenshots a month with no card.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




