Forum Discussion
xworker
12 years agoOccasional Contributor
Ok, solved it.
You have to create a context for the testStep where you currently are, like this:
import com.eviware.soapui.impl.wsdl.teststeps.*
def project = context.testCase.testSuite.project
def testSuite = project.getTestSuiteAt(5)
def testCase = testSuite.getTestCaseAt(1)
def testStep = testCase.getTestStepAt(1)
// this will get the current teststep name
def teststepname = testStep.getName().toString()
//create a context for the teststep where we are
def testStepContext = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext(testStep);
//create a util on the testStepContext
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( testStepContext )
def inputHolder = teststepname + "#Request"
def holderRawReq = groovyUtils.getXmlHolder(inputHolder)
holderRawReq["//tem:brandId"] = "test7"
holderRawReq.updateProperty()
You have to create a context for the testStep where you currently are, like this:
import com.eviware.soapui.impl.wsdl.teststeps.*
def project = context.testCase.testSuite.project
def testSuite = project.getTestSuiteAt(5)
def testCase = testSuite.getTestCaseAt(1)
def testStep = testCase.getTestStepAt(1)
// this will get the current teststep name
def teststepname = testStep.getName().toString()
//create a context for the teststep where we are
def testStepContext = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext(testStep);
//create a util on the testStepContext
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( testStepContext )
def inputHolder = teststepname + "#Request"
def holderRawReq = groovyUtils.getXmlHolder(inputHolder)
holderRawReq["//tem:brandId"] = "test7"
holderRawReq.updateProperty()