One of the best SoapUI interview question and answer I have come across. Thank you, it was very useful. I will let you know, if I crack the interview :). Thank you again...
Hi author. Can you help me ? My problem: My test suite have 100+ test cases. I want to run a test kit in parallel. But at the same time I want to limit the threads so that I have only 3 test cases running in parallel at a time. How can i do this ?
I think you can refer this to achieve the way you want to execute tests in parallel (source: stackoverflow.com/questions/49001409/run-x-number-of-test-case-per-batch-on-groovy-scipt-soapui) import com.google.common.collect.*; // Get a list of the test cases in the suite and partition them into batches of 3 using Google Guava def testCases = context.getTestSuite().getTestCaseList(); def List testcasePartitions = Lists.partition(testCases, 3); // Loop through the partitions for (partition in testcasePartitions) { // Loop through the test cases in each partition for (testcase in partition) { if (!testcase.isDisabled()) { log.info("Running tests case " + testcase.getName()); def properties = new com.eviware.soapui.support.types.StringToObjectMap () testcase.run(properties, false) // Check the outcomes here if required. } } }
One of the best SoapUI interview question and answer I have come across. Thank you, it was very useful. I will let you know, if I crack the interview :). Thank you again...
Glad to know you found this useful Athira and all the best for your interview.
Hi author. Can you help me ?
My problem:
My test suite have 100+ test cases.
I want to run a test kit in parallel. But at the same time I want to limit the threads so that I have only 3 test cases running in parallel at a time. How can i do this ?
I think you can refer this to achieve the way you want to execute tests in parallel (source: stackoverflow.com/questions/49001409/run-x-number-of-test-case-per-batch-on-groovy-scipt-soapui)
import com.google.common.collect.*;
// Get a list of the test cases in the suite and partition them into batches of 3 using Google Guava
def testCases = context.getTestSuite().getTestCaseList();
def List testcasePartitions = Lists.partition(testCases, 3);
// Loop through the partitions
for (partition in testcasePartitions) {
// Loop through the test cases in each partition
for (testcase in partition) {
if (!testcase.isDisabled()) {
log.info("Running tests case " + testcase.getName());
def properties = new com.eviware.soapui.support.types.StringToObjectMap ()
testcase.run(properties, false)
// Check the outcomes here if required.
}
}
}