I have a TestNG test Suit for a JAVA Project and, In there I have a
@Test(DataProvider="ListOfObjects") annotated Method. Which provides method with around 20 rows of data.( Hence the method runs 20 times.) Now, I want to run this class for 2hrs (part of SOAK related test.) On average the Class takes around 10 mins for single run. So I am thinking or running the whole class for 12 times, and thus thinking of using @Test(invocationCount = 20) on the Class itself. Any Better Ideas ?
Found an Embarrassingly simple solution: Repeating the whole Test Suit as follows
@Test
public void RepeatTestSuite() {
long startTime = new Date().getTime();
while(!isTestFinished(startTime)) {
List<String> suites = new ArrayList<String>();
suites.add("./SOAK_all41.xml"); //path of .xml file to be run-provide complete path
TestNG tng = new TestNG();
tng.setTestSuites(suites);
tng.run(); //run test suite
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With