Forum Discussion
Aaronliu
14 years agoFrequent Contributor
this should be easy to fetch the designated values from xml:
thanks,
Aaron
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder("MyTestStepName#Response")
declare namespace['a'] = "http://schemas.data.org/2004/07/Data"
declare namespace['b'] = "http://www.test.com/Data"
def count = holder.getNodeValue ("count(//a:GetDerResult/a:Derivative)")
def counter = count.toInteger()
if (counter !=0){
(0..<counter).each{
def name = holder.getNodeValue("//a:GetDerResult/a:Derivative["+it+"]/b:Name")
log.info name
}
}
thanks,
Aaron