如何动态安排 TestNG 运行的测试?
在给定的套件中,使用 10 个线程并有 100 个测试,我想提供动态运行的测试,以便下一个要运行的剩余测试中的测试用例需要由我自己的逻辑确定,并在线程完成时交给 TestNg当前测试/测试。
简而言之,我如何动态安排 TestNG 运行的测试?
在下面添加更多信息
假设我要使用 10 个线程运行 100 个测试。通常,测试将随机选取并执行。在这里,当线程完成当前测试运行时,我需要控制运行下一个测试。 简单来说,这将帮助我们锁定和解锁产品上的对象并安排测试,以便通过共享现有资源来并行运行更多测试。
每次想要运行下一个测试时,最终都需要重新排序剩余的测试。需要一种方法在 testNg 中做到这一点
In a given suite which uses 10 threads and has 100 tests I want to provide tests to be run dynamically so that next to be run test case out of remaining tests need to determined by my own logic and given to TestNg when thread(s) completes current test/tests.
Simply put how can I dynamically schedule the tests to be run by TestNG?
Adding more info below
Let's say I have 100 tests to run with say 10 threads. typically tests will be picked up in random and executed. Here I need control on next test to be run when a thread finishes current test run.
In simple terms this will help us to lock and unlock the objects on product and schedule the tests such that more tests can run in parallel by sharing existing resources.
Ultimately need to reorder the remaining tests every time want to run the next test & need a way to do it in testNg
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
@Factory 允许您动态创建测试类。
@Factory lets you create test classes dynamically.