messageExchange not recognised
When I try to execute this script , I get this pop up which says groovy.lang.MissingPropertyException:No such property:messageExchange for class: Script35
Please find the screenshot of the pop up attached.
I desperately need this to work ,where am I making a mistake?
def holder = groovyUtils.getXmlHolder(testRunner.testCase.testSteps["XXXStepName"].testRequest.response.getContentAsXml());
Thanks a lot for the reply, your code does work, however, I would like to use the messageExchange for the same purpose.
Below is the code which I use :
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def holder = groovyUtils.getXmlHolder(messageExchange.responseContent)
I am creating context ,but still i get the same error.Do you know any possible reason for this.I am using soapui pro 3.5
exactly where in soapUI are you running this script?
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
The syntax is valid, assuming you are running it in Script Assertion.
Moreover, please make sure your response is in xml format. Some api may sometimes return both json or xml if you does not specifically specify what you accept.
To make sure your response is accepting an xml, adding an Accept header in your request will help.