Thursday, 10 January 2013

ReportNG - HTML/XML Reporting Plug-in for TestNG

ReportNG is a simple HTML reporting plug-in for the TestNG unit-testing framework. It is intended as a replacement for the default TestNG HTML report. The default report is comprehensive but is not so easy to understand at-a-glance. ReportNG provides a simple, colour-coded view of the test results.

Disable the Default Listeners first

Project (right-click) > Properties > TestNG > Tick “Disable default listeners” > Apply > ok

The reportng-1.1.3.jar and velocity-dep-1.4.jar files must be included in the classpath to run the tests.

Download ReportNG (jar) files 
 Download reportng.jar
 Download velocity.jar

Check your project .classpath after build configure;

<classpathentry kind="lib" path="lib/velocity-dep-1.x.jar"/>
<classpathentry kind="lib" path="lib/testng-6.x.jar"/>
<classpathentry kind="lib" path="lib/reportng-1.1.x.jar"/>

Create the xml file by copying the below code: 

Right-click your Project/Class file > TestNG > "Convert to TestNG" > Edit the xml code by adding LISTENERS given below > Finish

<?xml version="1.0" encoding="UTF-8"?>
<suite name="Suite" parallel="false">
      <listener class-name="org.uncommons.reportng.HTMLReporter"/>
      <listener class-name="org.uncommons.reportng.JUnitXMLReporter"/>
  <test name="Test">
      <class name="package.classname"/>
  </test> <!-- Test -->
</suite> <!-- Suite -->

Now run the TestNG framework by right clicking the .xml file from eclipse

Sample Report1 ReportNG
Sample Report2 ReportNG


  1. Hi,
    I followed the above steps, still I am not getting the ReportNg report.
    It just displays this:

    Generated by TestNG with ReportNG at 11:00 IST on Tuesday 23 July 2013
    Pankaj@Sushma-PC / Java 1.7.0_25 (Oracle Corporation) / Windows 7 6.1 (amd64)
    Test Results Report
    Duration Passed Skipped Failed Pass Rate

  2. The following jar was required with ReportNG 1.1.4 and TestNG 6.8.

  3. Hi,

    I have followed the above mentioned steps to generate reportng but im not able to get it and added a following jars also ReportNG 1.1.4 and TestNG 6.8.

  4. Replies
    1. You should try again to come to ground floor to consult with me.

  5. add guice
    3.0 jar in your project

  6. User pdfreport plugin for testng pdfreport generation which work same as reportng

  7. Refresh your project then will get html folder. in that go to index.html and open it in a web browser.


  8. Thanks for the great information in your blog Selenium Training in Chennai

  9. For annotation tests in testNG, Is there any way we can display the description in reportNG html reports

  10. Hi,

    Am added the required jar files and added

    in my xml file.
    When am trying ti run as testng suite it throws an error
    Listener org.uncommons.reporting.HTMLReporter was not found in project's classpath

    I checked in classpath and the following path is there as

    can you please tell me why am facing this issue.
    Please help.

    1. did you get any solution?

  11. Hi, i am getting an error
    Listener org.uncommons.reportng.HTMLReporter was not found in project's classpath

    although i have added all of these 3 jar files in my project and added listner tag in xml file

  12. Amazing, thanks a lot my friend, I was also siting like a your banner image when I was thrown into Selenium.
    When I started learning then I understood it has got really cool stuff.
    I can vouch webdriver has proved the best feature in Selenium framework.
    thanks a lot for taking a time to share a wonderful article.
    Selenium Training in Velachery |

  13. The infinity of software testing is on the accurate note. It contributes huge career forecasts for talented specialists to be skilled software testers.Thanks for the very gradually information.
    Selenium Training in Chennai
    Selenium Testing Training in Chennai

  14. That is very interesting; you are a very skilled blogger. I have shared your website in my social networks! A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article.
    Informatica Training in Chennai
    Python Training in Chennai
    AngularJS Training in Chennai
    Best AngularJS Training in Chennai