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-
Once you have these three jar files, please include them in your project-
Here I am considering that you already have TestNg.xml file inside your project; if Yes, please include below listeners inside suite tag-
Once you done, your testng.xml file should look like this-
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.
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.
Your report should look like this after all above set-up-