Multi Thread a Loop in a Groovy Script that calls another test case
Hello,
I have a project set up with one test suite, and two test cases within them. One test case contains a number of test steps that contain various assertions based on the response message from a REST response and what it should contain. The request message in this test case has several variables which are set by calling a properties table.
Separately, the second test case contains a Groovy script, which is designed to run through the first test case a number of times. In this script I have various lists of data. The script then cycles through each list, and amends the variables in the first testcases properties, each amendment being a separate run of the first testcase.
This is all done within a loop. The problem is that this means each test is run sequentially which is not efficient. Is there a better way to do this? The loop is set up like so -
for(int NumCycle = 0;NumCycle<2;NumCycle++){ (Ifs that amends some variables)
for (X in Variables){
runner = testCase.run(new com.eviware.soapui.support.types.StringToObjectMap(), true);
(then all my bits to log out the results of each assertion on each step)
runner.waitUntilFinished()}}
So when I press play on the Groovy script, I'm able to loop through twice and amend the variables to what I need them to be for each run. This all works, but is slow because its one request/response per loop. Anyway to resolve?
Thanks in advance!