[英]Use one class more than once in TestNG
使用TestNG和Selenium运行的测试中有一个结构示例:
<test>
<classes>
<class name="com.pou.MyTest">
<methods>
// params here
<include name="myMethodOne" />
</methods>
</class>
<class name="com.pou.MyTest">
<methods>
// params here
<include name="myMethodTwo" />
</methods>
</class>
</classes>
</test>
运行此套件后,我收到一个错误:
org.testng.TestNGException:在[DynamicGraph中找不到免费的节点
有人告诉我,这是由于一次调用同一方法两次引起的
现在的问题是:我可以在一个测试中两次使用同一个类吗?
我还要补充一点,由于某些原因,我需要在一个测试中进行测试,因此将其拆分为两个不同的测试并不是我所需要的方法。
考虑使用@DataProvider
代替,类只能在每个测试标记中出现一次。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.