如何在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 10岁高考祝福语简短
16 孩子生日刺青祝福语简短
17 正月十五简短谜语祝福语
18 虎年春节拜年祝福语简短