Contributions
Re: How to save response data in Excel/CSV format in SOAP UI 5.2.1?
You need to use an Excel API to communicate or manipulate data in the Excel files. Download Java Excel API andplace the JXL.jar file in the “lib” folder of your SoupUI installation directory. Assume the response is like: <Response xmlns="http://localhost/something"> <content>some content</content> <id>100</id> </Response> Add aGroovy test step import jxl.* import jxl.write.* def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ) def holder = groovyUtils.getXmlHolder("RequestStep#ResponseAsXml") // Change RequestStep name log.info holder.getXml() // will display /Log the response in Xml WritableWorkbook workbook = Workbook.createWorkbook(new File("C:/output.xls")) WritableSheet sheet = workbook.createSheet("Worksheet 1", 0) log.info(sheet.isHidden()) xPath1 = "//*:id/text()" // use xPath to access the value from response xPath2 = "//*:content/text()" log.info holder.getNodeValue(xPath1) log.info holder.getNodeValue(xPath2) Label label = new Label(0, 1, holder.getNodeValue(xPath1)); //column=0,row=1 sheet.addCell(label); Label label1 = new Label(2, 2, holder.getNodeValue(xPath2)); //column=2,row=2 sheet.addCell(label1); workbook.write(); workbook.close();14KViews3likes2Comments