Testng.xml文件结构组成及节点属性说明
作者:网络转载 发布时间:[ 2014/11/27 15:53:06 ] 推荐标签:软件测试 测试报告
testng.xml文件结构:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="suitename" junit="false" verbose="3" parallel="false" thread-count="5" configfailurepolicy="<span style="font-family:Arial;"><span style="font-size: 14px; line-height: 26px;">skip</span></span>" annotations="javadoc" time-out="10000" skipfailedinvocationcounts="true" data-provider-thread-count="5" object-factory="classname" allow-return-values="true"> <!-- name参数为必须 -->
<suite-files>
<suite-file path="/path/to/suitefile1"></suite-file> <!-- path参数为必须 -->
<suite-file path="/path/to/suitefile2"></suite-file>
</suite-files>
<parameter name="par1" value="value1"></parameter> <!-- name, value参数为必须 -->
<parameter name="par2" value="value2"></parameter>
<method-selectors>
<method-selector>
<selector-class name="classname" priority="1"></selector-class> <!-- name参数为必须 -->
<script language="java"></script> <!-- language参数为必须 -->
</method-selector>
</method-selectors>
<test name="testename" junit="false" verbose="3" parallel="false" thread-count="5" annotations="javadoc" time-out="10000" enabled="true" skipfailedinvocationcounts="true" preserve-order="true" allow-return-values="true"> <!-- name参数为必须 -->
<parameter name="par1" value="value1"></parameter> <!-- name, value参数为必须 -->
<parameter name="par2" value="value2"></parameter>
<groups>
<define name="xxx"> <!-- name参数为必须 -->
<include name="" description="" invocation-numbers="" /> <!-- name参数为必须 -->
<include name="" description="" invocation-numbers="" />
</define>
<run>
<include name="" /> <!-- name参数为必须 -->
<exclude name="" /> <!-- name参数为必须 -->
</run>
<dependencies>
<group name="" depends-on=""></group> <!-- name,depends-on均为参数为必须 -->
<group name="" depends-on=""></group>
</dependencies>
</groups>
<classes>
<class name="classname"> <!-- name参数为必须 -->
<methods>
<parameter name="par3" value="value3"></parameter>
<include name="" description="" invocation-numbers=""></include>
<exclude name=""></exclude>
</methods>
<methods></methods>
</class>
</classes>
<packages>
<package name="" /> <!-- name参数为必须 -->
<package name="">
<include name="" description="" invocation-numbers=""></include>
<exclude name=""></exclude>
</package>
</packages>
<listeners>
<listener class-name="classname1" /> <!-- name参数为必须 -->
<listener class-name="classname2" />
</listeners>
</test>
<test></test>
</suite>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="suitename" junit="false" verbose="3" parallel="false" thread-count="5" configfailurepolicy="<span style="font-family:Arial;"><span style="font-size: 14px; line-height: 26px;">skip</span></span>" annotations="javadoc" time-out="10000" skipfailedinvocationcounts="true" data-provider-thread-count="5" object-factory="classname" allow-return-values="true"> <!-- name参数为必须 -->
<suite-files>
<suite-file path="/path/to/suitefile1"></suite-file> <!-- path参数为必须 -->
<suite-file path="/path/to/suitefile2"></suite-file>
</suite-files>
<parameter name="par1" value="value1"></parameter> <!-- name, value参数为必须 -->
<parameter name="par2" value="value2"></parameter>
<method-selectors>
<method-selector>
<selector-class name="classname" priority="1"></selector-class> <!-- name参数为必须 -->
<script language="java"></script> <!-- language参数为必须 -->
</method-selector>
</method-selectors>
<test name="testename" junit="false" verbose="3" parallel="false" thread-count="5" annotations="javadoc" time-out="10000" enabled="true" skipfailedinvocationcounts="true" preserve-order="true" allow-return-values="true"> <!-- name参数为必须 -->
<parameter name="par1" value="value1"></parameter> <!-- name, value参数为必须 -->
<parameter name="par2" value="value2"></parameter>
<groups>
<define name="xxx"> <!-- name参数为必须 -->
<include name="" description="" invocation-numbers="" /> <!-- name参数为必须 -->
<include name="" description="" invocation-numbers="" />
</define>
<run>
<include name="" /> <!-- name参数为必须 -->
<exclude name="" /> <!-- name参数为必须 -->
</run>
<dependencies>
<group name="" depends-on=""></group> <!-- name,depends-on均为参数为必须 -->
<group name="" depends-on=""></group>
</dependencies>
</groups>
<classes>
<class name="classname"> <!-- name参数为必须 -->
<methods>
<parameter name="par3" value="value3"></parameter>
<include name="" description="" invocation-numbers=""></include>
<exclude name=""></exclude>
</methods>
<methods></methods>
</class>
</classes>
<packages>
<package name="" /> <!-- name参数为必须 -->
<package name="">
<include name="" description="" invocation-numbers=""></include>
<exclude name=""></exclude>
</package>
</packages>
<listeners>
<listener class-name="classname1" /> <!-- name参数为必须 -->
<listener class-name="classname2" />
</listeners>
</test>
<test></test>
</suite>
相关推荐
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11