deepthireddy
5 years agoNew Contributor
Groovy SCript for taking specific tag values into getDOMNodes
I have below response from SOAP UI <m:bansArray> <m:item> <m:ban>4382640110 056</m:ban> <m:banNickname></m:banNickname> <m:billingAddressLine1>10500 RYAN</m:billingAddressLine1> <m:billingAddre...
- 5 years ago
Hi deepthireddy :
Hope you will get help from below code 🙂
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ) def holder = groovyUtils.getXmlHolder( "SOAP Request#Response" ) def nodes = holder.getDomNodes( "//*" ) def XMLlist = [] for( node in nodes ) { if(!(node.getNodeName().toString().contains("m:serviceCodeEnglishDescription") || node.getNodeName().contains("m:serviceCodeFrenchDescription") || node.getNodeName().contains("m:transpromoStatus")) ){ def value = com.eviware.soapui.support.xml.XmlUtils.getNodeValue( node ) if((value!=null)) { if( !(value.isAllWhitespace())) XMLlist.add(value) } } } def Slist = XMLlist.size() log.info "SOAP UI RESPONSE" + XMLlist