简体   繁体   中英

how can I dynamically schedule the tests to be run by 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

@Factory使您可以动态创建测试类。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM