java在套件中从testNG运行一个测试
我的测试。xml文件如下所示
<suite name="suitename">
<test name="testname1">
<classes>
<class
name="com.org.test1" />
</classes>
</test>
<test name="testname2">
<classes>
<class
name="com.org.test2" />
</classes>
</test>
我尝试使用命令行java org.testng TestNG test.xml -testname testname2
来运行第二个类。但是,它运行这两个测试
如何解决这个问题
谢谢
# 1 楼答案
如果我们想跳过测试用例任何部分的执行,我们可以在
testng.xml
文件中使用exclude
标记。请查找以下跳过执行testname1
测试的xml文件:希望这有帮助
# 2 楼答案
下面是从testng执行所需测试的命令。来自命令提示符的xml
我希望您使用了调用defult套件的-testname
谢谢,, 穆拉里