TestNG Report
How to generate report with TestNG
Habtamu Petros
Last Update 3 years ago
TestNG Reports come into the picture once we execute the test cases using TestNG. Once we execute test cases using TestNG, it will generate a default HTML report. When we run the test, there are two separate sections in the Eclipse where reports are visible.
- Console
- Report Section
Console Reports in TestNG
Console reports in TestNG are short and simple, which just denote the overall summary of the test.

TestNG Report Section in Eclipse
Alongside the console tab, the reports tab lies in Eclipse which generates a more in-depth view than what we had in the console. The report contains the summary, failed tests, and all tests that we saw in the console part

Along with that, the time taken to execute the "f()" test method is available alongside. It is the default view that comes under the "All Tests" part.

Generate Report in TestNG?
We can generate the TestNG reports in two ways:
- Emailable Reports
- Index Reports
Generate Emailable Report in TestNG
Emailable reports are generated in TestNG to let the user send their test reports to other team members. Emailable reports do not require any extra work from the tester, and they are a part of the overall test execution. To generate emailable reports, first, run the TestNG test class if you have not already. Once we have run the test case, a new folder generates in the same directory with the name test-output.

Open this test-output folder. It will contain multiple files in it. From those, we will focus on an emailable-report.html file.
Right-click on the file. Choose Open With -> Web Browser.

Generate Index Report in TestNG
Another important file that resides inside the test-output folder is index.html. Emailable reports are a type of summary reports that one can transfer to other people in the team through any medium. Index reports, on the other hand, contains the index-like structure of different parts of the report, such as failed tests, test file, passed test, etc.
To open the index.html file, locate it in the same test-output folder.

Similar to the above report, open this one in the browser.

