Forum Discussion
deepesh_jain
15 years agoFrequent Contributor
Oh I now see what you are trying to do. You can grab the values of both guid and name. And if the value of name matches specific value say ABC, you can use it otherwise discard it. Below is an example of code:
Regards,
Deepesh Jain
def gutils = new com.eviware.soapui.support.GroovyUtils (context);Let me know if this helps.
def holder = gutils.getXmlHolder("YOUR_SOAP_TEST_STEP_NAME#Response");
def totalcount = holder["count(//node1/node2)"] ;
// The above line will give you a total count of nodes which you need to read.
for (i in 1..Integer.parseInt(totalcount))
{
def name1 = holder.getNodeValue("//node1/node2[i]/name") ;
def guid1 = holder.getNodeValue("//node1/node2[i]/guid") ;
if (name1 == "ABC")
{
// do something
}
}
Regards,
Deepesh Jain