如何从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()将被排除在执行之外。
热门推荐
1 狗狗技能训练
5 如何训练狗狗笑
6 狗狗训练排便
9 狗狗响片训练
10 如何训练狗狗不捡食
11 狗狗尿训练
12 怎么训练狗狗找东西
13 狗狗训练站立
14 狗狗训练飞盘
15 鞍山狗狗训练
16 怎样训练泰迪狗狗谢谢
17 狗狗外出训练
18 怎么训练金毛狗狗大小便