Pages

Generating Interactive ReportNG Reports For Selenium WebDriver Test

You can not show TestNG default reports to your manager or client because they are not much more readable and Interactive. ReportNG Is very good add-on to generate Interactive and readable reports for selenium webdriver tests. It Is simple HTML reporting plug-In. Also It Is very very easy to configure ReportNG with your selenium project. If you remember, XSLT reports are Interactive too and we have generated XSLT reports In webdriver datadriven framework. If you need XSLT reports then you can READ THIS POST.

Go to THIS PAGE and click on Download link as shown In bellow Image to download reportng-1.1.4.jar and velocity-dep-1.4.jar files.

Go to THIS PAGE and click on guice-3.0.zip download button as shown In bellow Image to download reportng-1.1.4.jar and velocity-dep-1.4.jar file.

STEP 2 : Add Jar Files In Project's Build path

Now you need to add above all three files In project's build path. If you don't know how to add jar files In project's build path then refer "Adding jar Files In Project's Build Path" section on THIS PAGE.

So now your Referenced Libraries folder have three more files as shown In bellow Image.

STEP 3 : Disable default listeners of testng

You need to disable default listeners of testng.

To disable default listeners

Right click on project folder In eclipse.

Go to Properties. - It will open Properties dialog.

Go to TestNG and check Disable default listeners checkbox as shown In bellow Image and click on OK button.

Pink color Highlighted lines are responsible to generate ReportNG reports so do not forget to Include them In your testng.xml file.

STEP 5 : Execute test and view ReportNG reports

Now run your test cases from testng.xml file. On completion of test execution, refresh your project folder. It will create/update test-output folder. Explore that folder then explore html folder. You will find index.html file Inside It. To open index.html file.

Right click on index.html file -> Open With -> Web Browser.

It will open ReportNG HTML Interactive report as shown In bellow Image.

After adding all three jars , I am not able to run the test cases ,it shows java.lang.NoClassDefFoundError: org/apache/commons/collections/ExtendedProperties at org.apache.velocity.runtime.RuntimeInstance.(RuntimeInstance.java:160) at org.apache.velocity.runtime.RuntimeSingleton.(RuntimeSingleton.java:95) at org.apache.velocity.app.Velocity.setProperty(Velocity.java:117) at org.uncommons.reportng.AbstractReporter.(AbstractReporter.java:62) at org.uncommons.reportng.HTMLReporter.(HTMLReporter.java:80) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)