Contributions
Re: To Write the "status response" from a REST" in a file,status different to "HTTP/1.0 200 OK".
Sorry Richie. Happy New Year 2020, Icouldn´t answer before because I was in holiday. I find interesting the solution you propose,could you send me an example with Data Sink and groovy script. I suppose taht I could also use the Data Source Loop too5 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.7KViews0likes2CommentsTo Write the "status response" from a REST" in a file,status different to "HTTP/1.0 200 OK".
Hi I have a script that writes me in an Excel Sheet the "status" response from a REST, for correct cases, but not the status different to "HTTP/1.0 200 OK". I would like to write this errors. What will I do? import com.eviware.soapui.support.GroovyUtils.*; import org.apache.poi.ss.usermodel.* import org.apache.poi.hssf.usermodel.* import org.apache.poi.xssf.usermodel.* import org.apache.poi.ss.util.* import groovy.json.JsonSlurper.* int fil = testRunner.testCase.getPropertyValue("Fila").toInteger(); int cel = testRunner.testCase.getPropertyValue("Col").toInteger(); cel++; def httpResponseHeaders = context.testCase.testSteps["PuntoVenta"].testRequest.response.responseHeaders def httpStatus = httpResponseHeaders["#status#"] log.info httpStatus def fs=new FileInputStream ("D:\\prueba\\Salida.xlsx") Workbook wb = WorkbookFactory.create(fs) def fil1 = wb.getSheet("Hoja1").getLastRowNum()+1 def hora = new Date().format("yyyy-MM-dd'T'HH:mm:ss SSS") log.info hora def row = wb.getSheet("Hoja1").createRow(fil1) row.createCell(0).setCellValue(new Date().toString()) row.createCell(1).setCellValue(httpStatus) fs.close(); def fo = new FileOutputStream ("D:\\prueba\\Salida.xlsx"); wb.write(fo); fo.close(); if(fil<5) { fil++; testRunner.testCase.setPropertyValue("Fila",fil.toString()); testRunner.gotoStepByName("Script"); // Se realiza el bucle para que vaya al script fila. } else { fil=0; cel=0; testRunner.testCase.setPropertyValue("Fila",fil.toString()); testRunner.testCase.setPropertyValue("Col",cel.toString()); }Solved5 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.8KViews0likes5Comments- 5 years agoPlace ReadyAPI QuestionsReadyAPI Questions5.2KViews1like1Comment
Re: RAW_XML_FILE_HEADER
It´s the same problem, the firts time that I executed the script show me RAW_XML_FILE_HEADER error, but the followings times, show me: "java.langNoClassDefFoundError:Could not initialize class org.apache.poi.poifs.filesystem.Magic error at line 14" import java.io.File; import java.io.FileInputStream; import java.util.Iterator; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.WorkbookFactory; String filepath = "D:\\prueba_estila\\Parametros1.xlsx" String sheetName = "Sheet1" FileInputStream fis = new FileInputStream(new File(filepath)) Workbook wb = WorkbookFactory.create(fis) Sheet sh = wb.getSheet(sheetName) Iterator itrRow = sh.rowIterator() while(itrRow.hasNext()) { Row row = itrRow.next() for(Cell cell : row) { switch(cell.getCellType()) { case Cell.CELL_TYPE_NUMERIC: log.info cell.getNumericCellValue() break; default: log.info cell.getRichStringCellValue() } } } fis.close() wb.close() In Ready API 2.8.0 show me the error but in SOAPUI 5.2.1 does not show error I´ve put the flowing libraries in ReadyAPI 2.8.0 poi-4.1.1.jar poi-excelant-4.1.1.jar poi-ooxml-4.1.1.jar poi-ooxml-schemas-4.1.1.jar poi-scratchpad-4.1.1.jar Could be any library incompatible with READY APi2.8.0?5 years agoPlace ReadyAPI QuestionsReadyAPI Questions5.2KViews0likes4CommentsRAW_XML_FILE_HEADER
Hi, I´m executing the folowing groovy script import java.io.* import java.lang.* import java.util.* import org.apache.poi.ss.usermodel.*; import org.apache.poi.hssf.usermodel.*; import org.apache.poi.xssf.usermodel.*; import org.apache.poi.ss.util.*; def fs = new FileInputStream ("D:\\Parametros1.xlsx"); Workbook wb = WorkbookFactory.create(fs); I d'ont undertand the following errorRAW_XML_FILE_HEADER in line Workbook wb = WorkbookFactory.create(fs); Could you lend me a hand?Solved5 years agoPlace ReadyAPI QuestionsReadyAPI Questions5.2KViews0likes7Comments