Forum Discussion
selkind
16 years agoOccasional Contributor
After spending another couple or so hours browsing this forum, I caught a hint on a similar problem with a solution for running a test case, different from the others I'd seen. Based on that, I was able to figure out another way to do this that works, but I have one question about that.
First, here's the load test setup script that successfully runs a warmup load from another test case, which creates a new WsdlLoadTestRunner object via a constructor, then calls start() on that:
import com.eviware.soapui.support.types.*
import com.eviware.soapui.impl.wsdl.teststeps.*
import com.eviware.soapui.impl.wsdl.loadtest.*
setup_Testcase = loadTestRunner.loadTest.testCase.testSuite.testCases["SmallDoc FourStreamWarmup TC"]
WsdlLoadTest setup_LoadTest = setup_Testcase.loadTests["FourStreamSmall 30 sec Warmup LT"]
WsdlLoadTestRunner runner = new WsdlLoadTestRunner(setup_LoadTest)
log.info("Running warmup LT: " + setup_LoadTest.name)
runner.start(true)
runner.waitUntilFinished()
log.info("Done with warmup")[/font:15dsj7ew]
Here's the leadup to the question. I first used runner.start(false)[/font:15dsj7ew], followed immediately by the log.info statement, figuring that the script would block until the started load test completed. In fact what happened was as far as I could tell the called load test never ran, I never see the result of the log.info, and the load test containing this setup script started immediately at the point - i.e., apparently the setup script terminated at the point I called runner.start(false)[/font:15dsj7ew].
I then change to the async invocation of the child load test with runner.waitUntilFinished()[/font:15dsj7ew] after it as shown above, and now it all works.
The question is - why don't I see the child load test run and this script block if I use runner.start(false)[/font:15dsj7ew]? I assume this is the designed behavior, I'd just like to understand it.
First, here's the load test setup script that successfully runs a warmup load from another test case, which creates a new WsdlLoadTestRunner object via a constructor, then calls start() on that:
import com.eviware.soapui.support.types.*
import com.eviware.soapui.impl.wsdl.teststeps.*
import com.eviware.soapui.impl.wsdl.loadtest.*
setup_Testcase = loadTestRunner.loadTest.testCase.testSuite.testCases["SmallDoc FourStreamWarmup TC"]
WsdlLoadTest setup_LoadTest = setup_Testcase.loadTests["FourStreamSmall 30 sec Warmup LT"]
WsdlLoadTestRunner runner = new WsdlLoadTestRunner(setup_LoadTest)
log.info("Running warmup LT: " + setup_LoadTest.name)
runner.start(true)
runner.waitUntilFinished()
log.info("Done with warmup")[/font:15dsj7ew]
Here's the leadup to the question. I first used runner.start(false)[/font:15dsj7ew], followed immediately by the log.info statement, figuring that the script would block until the started load test completed. In fact what happened was as far as I could tell the called load test never ran, I never see the result of the log.info, and the load test containing this setup script started immediately at the point - i.e., apparently the setup script terminated at the point I called runner.start(false)[/font:15dsj7ew].
I then change to the async invocation of the child load test with runner.waitUntilFinished()[/font:15dsj7ew] after it as shown above, and now it all works.
The question is - why don't I see the child load test run and this script block if I use runner.start(false)[/font:15dsj7ew]? I assume this is the designed behavior, I'd just like to understand it.