ContributionsMost RecentMost LikesSolutionsRe: Comparing the SOAP UI and database response values stored in arraylist and storing the resultCan someone please help me on this?Comparing the SOAP UI and database response values stored in arraylist and storing the result File fr = new File("C:\\ViewBANTestData.xls") Workbook wk = Workbook.getWorkbook(fr); WritableWorkbook workbook1 = Workbook.createWorkbook(fr,wk) WritableSheet sheet= workbook1.getSheet("Sheet1"); def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ) def holder = groovyUtils.getXmlHolder( "SOAP Request#Response" ) def GPSRequest = context.expand('${SOAP Request#Request}') def GPSResponse = context.expand('${SOAP Request#Response}') def slurper1 = new XmlSlurper() def DBholder = groovyUtils.getXmlHolder( "JDBC Request#ResponseAsXml" ) def xmlUtil = new com.eviware.soapui.support.xml.XmlUtils(); def nodes = holder.getDomNodes( "//*" ); def DBnodes = DBholder.getDomNodes( "//*" ); def list = [] def XMLlist = [] def DBXMLlist = [] 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 for( node in DBnodes ) { def DBvalue = com.eviware.soapui.support.xml.XmlUtils.getNodeValue( node ) if((DBvalue!=null)) { if(!(DBvalue.isAllWhitespace())) { DBXMLlist.add(DBvalue.trim()) } } } log.info "DB RESPONSE =" + DBXMLlist def DBSlist=DBXMLlist.size() I have above code in that my SOAP UI Response is getting stored inXMLlist "SOAP UI RESPONSE" + XMLlist and my Database response is stored in DBXMLlist DB RESPONSE =" + DBXMLlist like below SOAP UI RESPONSE[5275495390, 1219 CHRISTIE CIR, MILTON, ON, Sterling Insurance Brokers, L9T6V4, 527749, NM1, B, Y, NM1IPBB] DB RESPONSE =[5275495390, 1219 CHRISTIE CIR, MILTON, ON, Sterling Insurance Brokers, L9T6V4, 527749, NM1, B, Y, NM1IPBB] So till here my script is working fine but after this i want to compare each value of SOAP UI Response and Database Response for multiple iterations and store the result for each iteration in Excel. Re: Groovy SCript for taking specific tag values into getDOMNodes yes the script is working. Thank you so much 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:billingAddressLine2>DORVAL QC</m:billingAddressLine2> <m:billingName>DICOM TRANSPORTATION</m:billingName> <m:billingPostalCode>H9P2T7</m:billingPostalCode> <m:idrCustomerAccountId>506757</m:idrCustomerAccountId> <m:invoiceSystemCode>CBSS</m:invoiceSystemCode> <m:marketSegment>B</m:marketSegment> <m:paperSuppressionFlag>Y</m:paperSuppressionFlag> <m:serviceCode>CBSS</m:serviceCode> <m:serviceCodeEnglishDescription>Phone</m:serviceCodeEnglishDescription> <m:serviceCodeFrenchDescription>Téléphonie</m:serviceCodeFrenchDescription> <m:transpromoStatus>A</m:transpromoStatus> </m:item> </m:bansArray> I dont want to take the node values ofserviceCodeEnglishDescription, serviceCodeFrenchDescription andtranspromoStatus I have written below Groovy scripting it is taking all the Node values 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 ) { 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 Here in my SOAP UI REsponse im getting all node values SOAP UI RESPONSE[4382640110 056, 10500 RYAN, DORVAL QC, DICOM TRANSPORTATION, H9P2T7, 506757, CBSS, B, Y, CBSS, Phone, Téléphonie, A] But i dont want all tags in SOAP UI RESPONSE. could you please help Solved