Interview Questions

XML nodes -- Count nodes

SoapUI FAQ


(Continued from previous question...)

XML nodes -- Count nodes

Use the GroovyUtils class to create an XmlHolder, which you can use for a variety of XML related activities:

1.// create groovyUtils and XmlHolder for response of Request 1 request
2.def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
3.def holder = groovyUtils.getXmlHolder( "Request 1#Response" )
4.
5.def numberOfLinksInParagraphs = holder["count(//html/body/p/a)"]

(Continued on next question...)

Other Interview Questions