Configuring ReportNG with TestNG for HTML Reports

ReportNG is a simple plug-in for the TestNG unit-testing framework to generate HTML reports as a replacement for the default TestNG HTML reports. You can also customize html report with the help of TestNG listeners.

To use ReportNG reports we need to follow the below three steps:

Step 1: Add the below Jars Files to your project.


Please use the below links to download the jars.

Click here to Download ReportNG and Velocity jars. Click on downloads to download the jars. You just need to unzip and add to the project.

Click here to download Google Guice Jar. You need to unzip and add guice.jar once the download completes.

The structure should look like below:
ReportNG Jars

Step 2: The Most important step, to make sure reportNG reports, we need to disable the default TestNG Listeners.

It can be done by following the below steps:

1. Right Click on Properties
2. Click on TestNG
3. You will find an option as "Disable default listeners", check the checbox
4. Click on "Apply" button, it will show as message as "Project preferences are saved".
5. Now Click on "OK" button.

The screen should look like the below:

TestNG Properties

Step 3: We need to add the below two listeners to testng.xml file.

      <listener class-name="org.uncommons.reportng.HTMLReporter"/>
      <listener class-name="org.uncommons.reportng.JUnitXMLReporter"/>

Finally testng.xml file should look as the below for the given example :

<!DOCTYPE suite SYSTEM "" >
<suite name="Suite1" verbose="1" >
      <listener class-name="org.uncommons.reportng.HTMLReporter"/>
      <listener class-name="org.uncommons.reportng.JUnitXMLReporter"/>
  <test name="Regression Test Suite"   >
      <package name="packOne" />
      <package name="packTwo" />

The example code as follows:

Please add two packages as "packOne" and "packTwo" and a class for both the packages.

Package: PackOne
Class : demoOne

Here the first testcase will result in failure as i have used timeOut as 1000, to show you the report with both PASS and FAIL report.

package packOne;
import org.testng.annotations.Test;
public class demoOne {
	public void firstTestCase() throws InterruptedException
		System.out.println("im in first test case from demoOne Class");
	public void secondTestCase()
		System.out.println("im in second test case from demoOne Class");

Package : packTwo
Class : demoTwo

package packTwo;
import org.testng.annotations.Test;
public class demoTwo {
	public void firstTestCase()
		System.out.println("im in first test case from demoTwo Class");
	public void secondTestCase()
		System.out.println("im in second test case from demoTwo Class");

The below report is with the Default TestNG HTML Report.

TestNG Reports

Please execute the testcases/scripts to see the reports as below. After executing the testcases, Refresh the project folder to see the updated Reports. You will find a folder "html" and click on Index.html file to view the Report Generated By ReportNG

The below is the Overview Report generated after configuring the ReportNG with TestNG.

ReportNg Report Overview

The below is the Report generated after configuring the ReportNG with TestNG.

ReportNg Report

Test Frameworks: 


How to get the last two run(previous run report) in testng. I want to see last two run details for comparison. Is it possible or need any 3rd party jar ? Thanks..........

Why do we require Listeners to be added in XML, and to where to get the test output folder

Thanks! Very helpful.

how to remove Junit report and old report from test output it show only html report .

do i have add some jar file as like juice.jar,and reportng-1.1.4.jar

Very nice article, but after all the steps i am not able to see html folder under test-output folder. I have refreshed / restarted eclipse.
No luck. Could you please help me?
Can you please share sample project so that I can import and check it?
emaild Id:


I have done all the steps, but couldn't able to see html folder. Can you please help me? If possible can you please share sample project?

Hi myself Bala,

i followed the steps and i got issue once i run the testng.xml file, please look into it


Listener org.uncommons.reportng.HTMLReporter was not found in project's classpath
at org.testng.TestNG.initializeConfiguration(
at org.testng.remote.RemoteTestNG.initAndRun(
at org.testng.remote.RemoteTestNG.main(

Hi Bala,

Am getting the same error. is the issue at your end is resolved?
Could you please let me know how did you resolved.

How to change script to TestNG & get reports, from the webdriver java run script?

Add new comment