我有一个测试演员包设置要运行。但是,我想要排除的包中有一些测试用例。如果我不更改代码,我该怎么办?据我所知,testng没有在包中排除单个测试用例的功能。
答案 0 :(得分:1)
当您使用TestNg时,最简单的选择是在@Test注释后添加(enabled = false)。
@Test(enabled = false)
public void yourTestMethod() throws Exception {
//your code here
}
有关注释的信息,请参阅here。
答案 1 :(得分:0)
You can exclude methods and groups in TestNG,see [here.][1]
[1]: http://testng.org/doc/documentation-main.html#testng-xml
I am able to exclude method using following code :
<classes>
<class name="scripts.CheckTest" />
<class name="scripts.Day1" >
<methods>
<exclude name="verifyMobilePageTitle" />
</methods>
</class>
</classes>