xworker
12 years agoOccasional Contributor
how to access requests in other testCases/testSuites
Hi
This is my code, for testing I am getting the 5th testsuite, the first testcase and the first teststep. It is the getXmlHolder line the fails with "Unexpected CDATA" error. I have tried to add the testSuite and testCase to the inputHolder string but that doesn't help either. This script works as long as the script is in the same TestCase as the request it is trying to access. How to do this for other TestCases and other TestSuites?
Thx
This is my code, for testing I am getting the 5th testsuite, the first testcase and the first teststep. It is the getXmlHolder line the fails with "Unexpected CDATA" error. I have tried to add the testSuite and testCase to the inputHolder string but that doesn't help either. This script works as long as the script is in the same TestCase as the request it is trying to access. How to do this for other TestCases and other TestSuites?
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def project = context.testCase.testSuite.project
def testSuite = project.getTestSuiteAt(5)
def testCase = testSuite.getTestCaseAt(0)
def testStep = testCase.getTestStepAt(0)
def teststepname = testCase.getTestStepAt(0).getName().toString()
def inputHolder = +teststepname + "#Request"
log.info(inputHolder);
def holderRawReq = groovyUtils.getXmlHolder(inputHolder)
holderRawReq["//tem:brandId"] = "test"
Thx