Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to beautify the test report generated by TestNg

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report