WsdlTestRunContext

We know we can use context object if we are in the same test case. But if we are in different test cases or even in different test suites. For that we use the class WsdlTestRunContext.

For that we import that class in the test step from where we want to run another test step from a different test case or a test suite.

import com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext;

Lets see how to run a test step(Groovy Script1) from a different test step (Groovy script2) when both test steps are in different test cases but in same test suite

import com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext;
tSuite = testRunner.testCase.testSuite;//go to testSuite level
mytestStepz =  tSuite.testCases["TestCase 1"].testSteps["Groovy Script3"];//After going to test suite go to test case “TestCase1” and  then go to test step “Groovy Script 3”
def testStepContext  =  new WsdlTestRunContext(mytestStepz);//pass that test step into WsdlTestRunContext  object.
log.info "Calling Groovy Script 3"
mytestStepz.run(testRunner,testStepContext); //This statement will run the Groovy Script 3.
//so Basically we can first reach groovy script lying a  different test step.Then make object of WsdlTestRunContext and pass that 
//test step into it.Then use the run method on the same test step we want to run and pass the 
//test runner and WsdlTestRunContext  object into it.