After testing with testng, the HTML test report is automatically generated. The TESTNG-XSLT can be used to rewrite the test report.
Test-out/index.html
1. Download Testng-xslt and unzip on the official websiteLink:http://testng-xslt.googlecode.com/files/testng-xslt-1.1.2.zip
2. Copying FilesCopy the Saxon-8.7.jar and Saxonliason.jar under the Lib file to the project's Lib folder (if not new) and import it into the project/src/main/resources/testng-results.xsl To the project's Testout folder (if none is new)
4. Add Target to Build.xml{Name}: is the name of the project, {in} and {style}: corresponding to the XML and XSL that testng generated the report; {out}: is the file name and path to generate the report with TESTNG-XSLT; {expression} : is the path to generate the report with TESTNG-XSLT;
<path id= "Test.classpath" > <fileset dir= "${libdir}" includes= "*.jar"/> </path> <target name= " Testoutput "depends=" Runtest "> <xslt in=" ${testng.output.dir}/testng-results.xml "style=" ${testng.output.dir }/testng-results.xsl "out=" ${testng.output.dir}/index1.html "> <param name=" Testngxslt.outputdir "expression= "${basedir}/test-output/"/> <param name= "Testngxslt.showruntimetotals" expression= "true"/> <classpath Refid= "Test.classpath"/> </xslt> </target>
5. After running Build.xml, you can see the report after beautification .Test-out/index1.html