Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to beautify the test report generated by TestNg

Shulou Source: shulou.com Published: 2022-06-03 01:34:09 09月30日 Update

When we execute the Testng.xml to run the test case, we will generate a test-output folder under the project file, and open the following index.html file, which is the report of the Testng output.

1. Download TestNG-xslt and copy the saxon-8.7.jar package into the lib directory of the test project, and attach it to the project.

two。 Copy the file testng-results.xsl from the downloaded package to the test-output directory. The location of the testng-results.xsl file is testng-xslt-1.1.1/src/main/resources, and the test report is generated with this style.

3. Create a new build.xml with the following contents:

4. After you successfully execute this xml with ant, go to the test-output directory and view the generated index.html.

The report can clearly see the number of successful and failed case, as well as the exception thrown by the failed case.

Tags: File report test build directory success that is project number location content copy folder facet project output run attach Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology MySQL Linux Xiaomi Docker