recursion in Event afterRequest?
I've got a SoapUI project set up:
testcase1:
request 1
testcase2:
request 2
afterRequest script:
check http status, if 401 then run
testcase 2
When I run testcase1, the request in it sometimes returns 401, which means afterRequest script will run testcase2. But, when this happens I can see testcase2 get executed (and received on the server), but execution never returns to the afterRequest event script. The ReadyAPI UI shows that the tests are still running and they never complete.
Here's what the event script looks like:
def status = context.httpResponse.getStatusCode() if (status != 401) { return } def path = request.getPath() if (path != <request 1>) { return } def testSuite = context.getTestCase().getTestSuite() def refreshTestCase = testSuite.getTestCaseByName("testcase2") refreshTestCase.run(null, false) // never get here and UI spins forever
Are there limitations on what can be done in an event script like this? It seems like SoapUI is recursing, but I added checks to keep the script from executing testcase2 a second time, so not sure if that's what's going on.