Forum Discussion

masterkey88's avatar
12 years ago

How to cancel certain TestStep

It requires to cancel a specific TestStep (SoapRequest) in TestCase depending on condition. So I decided to create Groovy Script.


import com.eviware.soapui.impl.wsdl.teststeps.*;

String inMoney = context.expand( '${#Project#Money}' );
def step = testRunner.getTestCase().getTestStepByName("creditMoney");
log.info "step: $step";
if ((inMoney == '0') && (step instanceof WsdlTestRequestStep ) && (step != null))
step.cancel();


But it doesn't cancelled (returns always 'false').
If that was the last TestStep in TestCase, I could just call testRunner.cancel(), and it would work. But in my case this is not an option.
Does somedody have ideas to figure out this problem? Thanks.

1 Reply