cancel
Showing results for 
Search instead for 
Did you mean: 

Capture request node value with groovy script

Highlighted
Occasional 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/" xmlnsSmiley Surprisednd="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

New Here?
Join us and watch the welcome video:
SeptemberNews
Join the exciting event
SeptemberHubBub
Join the September Hub-bub to show off, learn and win