Interview Questions

How to change a request XML from groovy ?

SoapUI FAQ


(Continued from previous question...)

How to change a request XML from groovy ?

This example sets the password inside a request SOAP message:

01.def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
02.
03.// get XmlHolder for request message def
04.holder = groovyUtils.getXmlHolder( "login#Request" )
05.
06.// change password using XPath
07.holder["//username"] = "test"
08.
09.// write updated request back to teststep
10.holder.updateProperty()

(Continued on next question...)

Other Interview Questions