sukanya
6 years agoContributor
SoapUI Pro
Hi, How can I run a request using groovy script without using testRunner.runTestStepByName("Request"). Is there any other alternate way? Thanks
yeah testRunner won't be available there.
I dont think there will be any option to run your step from script assertion.
Thanks,
Himanshu
Is there any way I can do it?
Why dont you add groovy test step and take the response of your request there only and run what ever test step you have from that particular groovy test step itself.
I hope this will help you.
Thanks,
Himanshu
Yes, I can add there but my client requirement is to add it under the script assertion.
I think below will solve your problem.
import com.eviware.soapui.support.types.StringToObjectMap
import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner
def Runner = new WsdlTestCaseRunner(messageExchange.modelItem.testStep.testCase, new StringToObjectMap())
testStep= messageExchange.modelItem.testStep.testCase.testSuite.project.testSuites["A"].testCases["A"].testSteps["SOAP Request1"]
testStep.run(Runner,context)