如何在TestNG中将多个组合并为单个Test?
示例
用组测试xml文件。
<?xml version = "1.0" encoding = "UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name = "Nhooo Test">
<test name = "Regression Cycle 1">
<groups>
<run>
<include name = "QuestionAnswer"/>
</run>
<run>
<include name = "Jobs"/>
</run>
</groups>
<classes>
<class name = "TestParam" />
</classes>
</test>
</suite>要从测试用例集合中运行一组测试用例,我们必须在testngxml文件中定义<groups>。在这里,testNGxml包含与单个Test相关联的多个组QuestionAnswer和Jobs。
示例
@Test(groups={"QuestionAnswer"},{"Jobs"})
public void preparation(){
System.out.println("Preparation module is verified");
}在Java类文件中,分组为QuestionAnswer和Jobs的测试方法与该测试方法相关联preparation()。
热门推荐
10 对患者生日祝福语简短
11 结婚祝福语简短装备
12 周岁祝福语学生文案简短
13 订婚领证祝福语简短精辟
14 导师获奖祝福语大全简短
15 新婚购房祝福语简短精辟
16 牛年祝福语简短的爱人
17 送芒果的祝福语简短
18 送给学长毕业祝福语简短