ranjit96
9 years agoContributor
How to retrieve response of Test Step from one TestCase to another TestCase with groovy script ?
Here I want to retrieve "mul" Teststep response from "MulipleTestCase" and want to use this response in " Divide TestCase".
def groovyUtils= new com.eviware.soapui.support.GroovyUtils(context)
def teststep=context.testCase.testSuite.getTestCaseAt(1).getTestStepByName("mul")
def response=groovyUtils.getXmlHolder("mul#Response")
But I got an exception error "Unexpected Element:CDATA.."
Can you try something like below and see if that helps:
def testCaseName = 'Multiple testcase' def testStepName = 'mul' def response = context.testCase.testSuite.testCases[testCaseName].testSteps[testStepName].testRequest.responseContent log.info response