Search code examples
seleniumreportautomated-teststestngreportng

ReportNG does not provide any report


I heard that ReportNG creates a better report than TestNG's normal report. I tried to create ReportNG report, but failed. I am using Eclipse and I have downloaded ReportNG and added reportng-1.1.3.jar and velocity-dep-1.4.jar into classpath and written testng-suite.xml as below:

<suite name="SA" verbose="10">
<listeners>
  <listener class-name="org.uncommons.reportng.HTMLReporter" />
  <listener class-name="org.uncommons.reportng.JUnitXMLReporter" />
</listeners>
...
</suite>   

when I executed I could see the TestNG default report rather than ReportNG report. What else should I do to get ReportNG's report (like extend any class or implement listeners or write snippet of code)?

Also I heard that I have to use the command, useDefaultListeners="false" , but where should I include in the testng-suite.xml? Everyone is telling about ANT but I don't personally like it to use. So is there any way to include the above command into testng-suite.xml?


Solution

  • To disable defaultlisteners ,

    Goto Eclipse Project-> Properties -> TestNG -> Disable deafult listeners.
    

    After running you will end up with following error:

    java.lang.NoClassDefFoundError: com/google/inject/Module 
            at java.lang.Class.getDeclaredMethods0(Native Method) 
            at java.lang.Class.privateGetDeclaredMethods(Unknown Source) 
            at java.lang.Class.privateGetPublicMethods(Unknown Source) 
            at java.lang.Class.getMethods(Unknown Source) 
    

    to solve this, download google-guice-3.0.zip and paste guice-3.0.jar into your classpath.

    Now run and check the report in workspace/test-output/html.