自动化测试生成报告ReportNG

    自动化测试生成报告是一件非常重要的事情,报告的描述就决定了测试过程中的软件的bug问题,报告的易读性就非常重要,如果使用java做脚本的话选择性会小一点,ReportNG或许是最好的选择了,下面就是如何使用ReportNG生成对应的测试报告。

首先准备jar包:


按照对应的包名直接百度查询就可以了。

写一个配置文件就放在src下面:


test.xml内容:

<?xml version="1.0" encoding="UTF-8"?>
<suite name="Suite" parallel="false">
  <test name="Test" preserver-order="true">
    <classes>
      <class name="test.NewTest"/>
    </classes>
    
    <listeners>
		<listener class-name="org.uncommons.reportng.HTMLReporter" />
		<listener class-name="org.uncommons.reportng.JUnitXMLReporter" />
	</listeners>
    
  </test> <!-- Test -->
</suite> <!-- Suite -->

在代码里面写入报告内容;




运行脚本生成的报告格式:





主要就是做一下配置。代码下载:http://download.csdn.net/download/gaoxuaiguoyi/9980030

猜你喜欢

转载自blog.csdn.net/gaoxuaiguoyi/article/details/77988760