Forum Discussion
Aaronliu
13 years agoFrequent Contributor
the firstly you need to get correct response, next step to add property transfer step. in property transfer step, you'll see source and target. the source derive from steps you added and target is the destination. in both of them, you need to specify the data source using xpath expression. as for xpath, you would make sure of xpath assertion to help you declare namespace and copy that.
however, I recommend that you use groovy script to parse XML and then retrieve data:
however, I recommend that you use groovy script to parse XML and then retrieve data:
def groovyUtil = new com.eviware.soapui.support.GroovyUtils(context)
def xmlHolder = groovyUtil.getXmlHolder(messageExchange.responseContent) //if the script is a single step, using 'StepName#Response' in getXmlHoder('StepName#Response')
xmlHolder.namespaces['ns1'] = 'http://www.soapui.org/forum' //if namespace existing, you need to declare first
def val = xmlHolder.getNodeValue("//ns1:RootNode/ns2:Children") //xpath expression
log.info val
Related Content
- 3 years ago
Recent Discussions
- 15 years ago