Forum Discussion
3 Replies
Sort By
- nmraoChampion Level 3May be you can try doing using a groovy script.
- MHolmqvistOccasional ContributorAnyone got a Groovy example how to do this?
- EBaethkeContributorTrying 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)// 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)
}