ReportNG is third party reporting tool which can be plugged in with TestNG as listener.
ReportNG can be downloaded from http://reportng.uncommons.org/.
From this site, 2 jars are to be downloaded for use:
1. reportng-1.1.4.jar
2. velocity-dep-1.4
But, to run with testng-6.8.jar, those jar needs class "com.google.inject", which can be found in guice.jar.
This can be downloaded from https://code.google.com/p/google-guice/wiki/Guice40.
All 3 jars need to be in classpath. In below target "runTestNGTestCase, classpathref points to classpath which includes all classfiles and jars".
listeners attribute should be added with classnames separated by comma.
listeners="org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter">
So, target for running testNG with reportNG should look like as below:
<target name="runTestNGTestCase">
<testng classpathref="classes.test.location" outputDir="test-output" useDefaultListeners="true" listeners="org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter">
<classfileset dir="bin" includes="**/TestFlipKarHomePage.class" />
<sysproperty key="org.uncommons.reportng.title" value="My Test Report"/>
</testng>
</target>
ReportNG can be downloaded from http://reportng.uncommons.org/.
From this site, 2 jars are to be downloaded for use:
1. reportng-1.1.4.jar
2. velocity-dep-1.4
But, to run with testng-6.8.jar, those jar needs class "com.google.inject", which can be found in guice.jar.
This can be downloaded from https://code.google.com/p/google-guice/wiki/Guice40.
All 3 jars need to be in classpath. In below target "runTestNGTestCase, classpathref points to classpath which includes all classfiles and jars".
listeners attribute should be added with classnames separated by comma.
listeners="org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter">
So, target for running testNG with reportNG should look like as below:
<target name="runTestNGTestCase">
<testng classpathref="classes.test.location" outputDir="test-output" useDefaultListeners="true" listeners="org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter">
<classfileset dir="bin" includes="**/TestFlipKarHomePage.class" />
<sysproperty key="org.uncommons.reportng.title" value="My Test Report"/>
</testng>
</target>
No comments:
Post a Comment