Implement ReportNG in TestNG – User friendly Tech help

What is ReportNG?
nReportNG is a reporter add-on for TestNG that implements the report listener of TestNG. ReportNG reports provides better user interface(look and feel)compared to the original HTML reports. To generate a ReportNG report we have to add the reporting class to the list of listeners of TestNG while executing the tests. 
nLets implement this in our basic example that we have used in our First Test case with TestNG
n
nStep1:-
nDownload the required JAR files from :- 
nReportNG+Velocity 
nGuice-3.0

n

n

n

n

n

n

n

n

Downloading Guice-3.0.zip

n

Step2:-
nUnzip the JAR files and add to the project.
nHow to add JAR files in Eclipse

n

n

n

n

n

n

n

n

Adding Guice JAR’s 

n

Step3:-
nAdd listener to testng.xml file
nlistener class-name=”org.uncommons.reportng.HTMLReporter”
n
nJavaCode
n
nXML file:-
n

n












n

nNote:-
nIncase you are getting the below error,it can be due to missing JAR files in Guice, try adding them again.
n

n

n

n

n

n

n

n

n

Code Error 

n

n
nStep4:-
nObserving the results,
ntest-ouput ->html->index.html

n

n

n

n

n

n

n

n

index.html

n

n

n

n

n

n

n

n

Test Results in ReportNG

n

Note:– 
nWe can absorb Reporter.log messages inside output.html

n

n

n

n

n

n

n

n

Reporter.log messages in ReportNG

n

Data Parameterization in Selenium using TestNG

Was this article helpful?
YesNo

Similar Posts