当需要从 testng.xml 中的 2 个类运行测试时,为什么 TestNG 从类中随机选择方法?
我需要使用 TestNG 运行 2 个类的测试。 testng.xml 配置指定:
<classes>
<class name="com.xyz.TestA"></class>
<class name="com.xyz.TestB"></class>
</classes>
- TestA 具有方法: i1, i2, i3, i4
- TestB 具有方法: j1, j2, j3, j4
测试按以下顺序运行:
i1, i3, j1, j4, i2, i4, j2,j3
有谁知道原因吗? 请各位帮忙~ 非常感谢!
I need to run tests from 2 classes with TestNG.
The testng.xml configuration specifies this:
<classes>
<class name="com.xyz.TestA"></class>
<class name="com.xyz.TestB"></class>
</classes>
- TestA has methods: i1, i2, i3, i4
- TestB has methods: j1, j2, j3, j4
The tests run in the following sequence:
i1, i3, j1, j4, i2, i4, j2, j3
Does anybody know the reason?
Pls kindly help~
Many thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用的是最新的 TestNG,请使用“preserve-order”:
If you are using the latest TestNG, use "preserve-order":