0
votes

Background: I am using SoapUI 5.0.0 (not pro) and I have a testStep SCRIPT ASSERTION that I use to check the response that the testStep receives. If a certain condition is met, i wish to start another testStep (can run once the script is over).

My problem is: testRunner does not work in script assertion so I cannot use testRunner.gotoStepByName("step5")

My question: is there a different option I can call that does work in a script assertion that will make the test jump to that certain testStep ?

1

1 Answers

0
votes

In script assetion you've available context variable, this variable is an instance of com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext.

Through this class you can get com.eviware.soapui.model.testsuite.TestCaseRunner using getTestRunner() method and from here use gotoStepByName(String name).

You can use the follow code in your assertion script when your conditions are met:

context.getTestRunner().gotoStepByName('step5')

Note that running the script assertion "alone" the context.getTestRunner() returns null because you're running it in assertion context, the same applies if you run it from the TestStep. To get the runner property correctly you've to run the TestStep which contains the script assertion from the TestCase.

Hope this helps,