1

I'm load testing with SoapUI and within Test Case A i have a (groovy) script that is calling to run Test Case B using:

import com.eviware.soapui.model.testsuite.TestRunner.Status
def tc = def tc = testRunner.testCase.testSuite.testCases["Test Case B"]
def runner = tc.run( new com.eviware.soapui.support.types.StringToObjectMap (), false )
log.info "Status: $runner.status, time: $runner.timeTaken ms.
assert runner.status != Status.FAILED : runner.reason

The two last rows are little overkill here, but since its the assert that fails when i load test due to this is not thread safe I include them.

I've found that I need to set the runmode to "SINGLETON_AND_WAIT", but my question here is HOW i do that.

Cybermaxs
  • 24,378
  • 8
  • 83
  • 112
Pierre
  • 559
  • 9
  • 21

1 Answers1

2

There are several ways to manage this, check out the following calls. One of these approaches should be used after your tc.run(...).

// 1) Simply blocking wait for test to complete.
runner.waitUntilFinished()  

// 2) actively manage the wait
runner.isRunning()

// 3) actively manage with QoS time out.
while (runner.status == Status.RUNNING) {
    assert runnner.getTimeTaken() < 1000
}
Martin Spamer
  • 5,437
  • 28
  • 44