Contributions
Re: Automated methods to compare responses from 2 endpoints
Hi, You can use below script to fetch files from a folder. import java.io.File; import java.util.Date; import jxl.*; def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context) import groovy.sql.Sql def fileList = [] new File("path where u hv stored the files").eachFile{ f -> if (f.isFile()&& f.name.contains('.xml')) { def filename = f.name[0..-1] fileList.add(filename) log.info filename } } if (fileList.size() <1) { testRunner.fail("No request files found") } context.put('fileList',fileList)1.6KViews0likes1CommentAutomated methods to compare responses from 2 endpoints
I am performing data driven testing using groovy scripts by retrieving xml files stored in local drive and triggering requests to 2 end points. The responses from both the end points are collected and saved in local drive in xml formats. Please help in writing a groovy script for file comparison - the existence of first node from xml1 has to be validated in Xml2. Likewise it has to pick all the nodes from xml1 and validate its existence in xml2. Since i am performing this for bulk data, want to get this done through automated methods.1.6KViews0likes4Comments