Selenium WebDriver is open source test automation framework which does not come with reporting facility. So selenium user has to be depended upon the third party plug-ins.

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. There are very few steps to configure ReportNG with WebDriver+TestNG.

To configure it we need three jar files (Guice, ReportNG, and Velocity-dep) which you can download from here-

http://reportng.uncommons.org/

and

https://github.com/google/guice/wiki/Guice30

Once you have these three jar files, please include them in your project-

lib

Here I am considering that you already have TestNg.xml file inside your project; if Yes, please include below listeners inside suite tag-

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

Once you done, your testng.xml file should look like this-

TestNg

Now last step, disable the default testng listener by-

Right click on Project folder > click on Properties > click on TestNG which visible in left pane.

Test

All set, now run your testng.xml file and refresh your project. Once all done, It will add ‘test-output’ folder. Go to test-output > html > and open index.html to see the report.

report

Your report should look like this after all above set-up-

reports

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s