I am required 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 this code doesn't cancel the test step instead 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.