I'm new to SoapUI. I have a few TestSteps depending on each other. So i used the XML-Slurper to read Data from a response "deliverData" and stored them in my TestCase's properties.
def xml = new XmlSlurper().parseText(response)
def response = context.expand( '${deliverData#Response}' )
def ID = xml.Body.DeliverDataResponse."pollingId";
testRunner.testCase.setPropertyValue("pollingID",ID.text());
Now i want to use the pollingID for another request which like this
<soapenv:Body>
<DeliverRequest>?</DeliverRequest>
</soapenv:Body>
I read http://groovy.codehaus.org/Updating+XML+with+XmlSlurper but I do not see how to store manipulated data into the request? I'm not even sure about how to update.
Hope anybody can help me, i really do not like working with scripts, i prefer normal java coding:)
Thanks a lot!
john
ANSWER:
this is how it works, but not with the xmlslurper any more.
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( "DeliverStatus#Request" );
holder.setNodeValue( "//DeliverRequest", "200" );
holder.updateProperty();
Best Answer
The below code may help you sort your issue.