Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReportNG Report with TestNG is not generated using WebDriver

I am using Selenium WebDriver + TestNG with java in Eclipse. I want to generate better report using ReportNG rather than normal TestNG report. I have configured the build path with reportng-1.1.2.jar and velocity-dep-1.4.jar. I have also disabled the default TestNG Report from Project > Properties > TestNG > "Disable Default Listeners" Presently I have created a testNg.xml file that runs my tests as complete Test Suite. The content of xml file is as below:

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite thread-count="5" skipfailedinvocationCounts="false" verbose="1" preserve-order="true" name="testingXML" junit="false" parallel="false" annotations="JDK">
<test verbose="2" name="com.src.com.pcrm.pageobjects.*" junit="false" annotations="JDK">
<testng classpathref="test-path"
            outputdir="${test-results.dir}"
            haltonfailure="true"
            useDefaultListeners="false"
           listeners="org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter">
      <xmlfileset dir="." includes="testng.xml"/>
      <sysproperty key="org.uncommons.reportng.title" value="My Test Report"/>
    </testng>
<classes>
<class name="com.pcrm.pageobjects.HomeTest"/>
    <methods>   
        <include name="testManadatoryFieldsOnHomePage"/>
        <include name="testIsLogoDisplayed"/>
        <include name="testUrlCheck"/>
    </methods>

But When I executed this xml file it did not generate any ReportNG reports. What's the wrong? Help is appreciated.

like image 867
user1755344 Avatar asked Dec 04 '25 19:12

user1755344


2 Answers

My best guess is that it's a classpath issue. Make certain that the ReportNG and Velocity JARs are on the classpath. See this related question about a similar problem using ReportNG with Selenium.

like image 195
Dan Dyer Avatar answered Dec 08 '25 01:12

Dan Dyer


you may try this TestNG-XSLT report, it look greater and easier to read.

like image 25
cL83 Avatar answered Dec 08 '25 00:12

cL83



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!