如何从TestNG中的测试用例集合中合并和删除测试方法?
示例
Testngxml文件。
<?xml version = "1.0" encoding = "UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name = "Tutorialspoint Test ">
<test name = "Test Cycle">
<groups>
<run>
<include name = "Smoke"/>
<exclude name = "CodingModule"/>
</run>
</groups>
<classes>
<class name = "TestRegularExpression" />
</classes>
</test>
</suite>testNGxml具有要包含的Smoke组和要从执行中排除的CodingModule组。
示例
@Test(groups={"Smoke"})
public void ContactDetails(){
System.out.println(“Contact details verification is successful”);
}
@Test(groups={"CodingModule"})
public void verifyInvoice(){
System.out.println(“Invoice verification is successful”);
}在Java类文件中,组用于查明测试方法。组(例如Smoke)的测试方法将添加到运行中,而CodingModule将从执行中排除。因此,ContactDetails()测试方法将运行,但verifyInvoice()将被排除在执行之外。
热门推荐
10 小侄过生日祝福语简短
11 小店营业的祝福语简短
12 担任老师的祝福语简短
13 饮料吧台祝福语简短大气
14 公司新春搞笑祝福语简短
15 高情商敬酒祝福语简短
16 婚礼祝福语新郎妹妹简短
17 教师答辩通过祝福语简短
18 生女孩红包简短祝福语