cancel
Showing results for 
Search instead for 
Did you mean: 

Capture request node value with groovy script

Highlighted
Contributor

Capture request node value with groovy script

Hi All,

I would like to capture the values of Search Node, but the existing code returns me null values. What could be the issue here. I have written this code in ServiceV Pro.

Code:

def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def holder = groovyUtils.getXmlHolder(mockRequest.requestContent)
def queryString = holder.getNodeValue("//ond:search")
log.info "QueryString: " + queryString

Request XML

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ond="http://www.qas.com/OnDemand-2011-03">
<soapenv:Body>
<ond:QASearch Localisation="" RequestTag="Intuitive">
<ond:Country>AUE</ond:Country>
<ond:Layout></ond:Layout>
<ond:search>1 Lonsdale Close, LAKE HAVEN NSW 2263</ond:search>
<ond:FormattedAddressInPicklist>false</ond:FormattedAddressInPicklist>
</ond:QASearch>
</soapenv:Body>
</soapenv:Envelope>

Thanks

Senthil kumar.M

1 REPLY 1
Highlighted
Community Hero

Re: Capture request node value with groovy script

This is very late reply due to incorrect forum. Do you still have issue? Are you using the above in Script Dispatch?


Regards,
Rao.
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors