Forum Discussion
EBaethke
11 years agoContributor
Trying putting this script in your TestSuite's "Setup Script".
(It requires that all of the TestCases be disabled, but its just a proof-of-concept)
(It requires that all of the TestCases be disabled, but its just a proof-of-concept)
// Get list of test cases
myTestCases = testSuite.getTestCaseList();
// Shuffle the list
long seed = System.nanoTime();
Collections.shuffle(myTestCases, new Random(seed));
boolean aFailureOccured = false;
// Run each test case
for(testCase in myTestCases){
def properties = new com.eviware.soapui.support.types.StringToObjectMap ()
def async = false
result = testCase.run(properties, async).getStatus().toString();
if (result == "FAILED"){
aFailureOccured = true;
}
}
// Set the TestSuite's result
if (aFailureOccured){
runner.setStatus(com.eviware.soapui.model.testsuite.TestRunner.Status.FAILED)
} else {
runner.setStatus(com.eviware.soapui.model.testsuite.TestRunner.Status.FINISHED)
}