Forum Discussion
Excuse me if I am explaining things you aready know, but you mentioned you were new to SoapUI. The "error log" can be found at the bottom of the screen, see the highlighted area 5 on the following page:
https://www.soapui.org/getting-started/soapui-interface/main-window.html
To get the log nmrao requested, open the error log, clear it (should be a right click menu option), then run your test again, then copy and paste the log contetents here.
Radford, nmrao sorry, found the exception text in SoapUI log window, error log is absolutely empty:
- Wed May 17 13:38:55 CEST 2017:ERROR:Exception during Test Execution
- java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
- at com.ubs.soapuiengine.ExtendedError.afterStep(ExtendedError.java:20)
- at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:222)
- at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:47)
- at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:138)
- at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:46)
- at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:129)
- at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
- at java.util.concurrent.FutureTask.run(Unknown Source)
- at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
- at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
- at java.lang.Thread.run(Unknown Source)
Please find the full script of step 1 below:
import com.eviware.soapui.support.XmlHolder
import jxl.*
import jxl.write.*
def myTestCase = context.testCase // creating instance of testCase
propTestStep = myTestCase.getTestStepByName("Properties") // read the properties
// CAPTURE PROJECT CUSTOM PROPERTIES - OUTPUT FOLDER AND INPUT FILE
output = testRunner.testCase.testSuite.project.getPropertyValue("OutputFolder")
xlsFile = testRunner.testCase.testSuite.project.getPropertyValue("InputFile")
log.info xlsFile
propTestStep.setPropertyValue("Datasheet", "flattenPdfForm")
Workbook workbook1 = Workbook.getWorkbook(new File(xlsFile)) //reading file containing the data
Sheet sheet1 = workbook1.getSheet(0) // reading 1st sheet in the excel
size = sheet1.getRows().toInteger() // getting number of rows
propTestStep.setPropertyValue("Total", size.toString()) // save number of rows to the "Total" property
counter = propTestStep.getPropertyValue("Count").toString() // create variable for iteration number
counter = counter.toInteger()
next = (counter+1) //set the next value
//// READING EXCEL
Cell a = sheet1.getCell(1,counter)
Cell b = sheet1.getCell(2,counter)
Cell c = sheet1.getCell(3,counter)
Cell d = sheet1.getCell(4,counter)
Cell e = sheet1.getCell(5,counter)
Cell f = sheet1.getCell(6,counter)
Cell g = sheet1.getCell(7,counter)
workbook1.close() //close the file
// SAVING VALUES IN THE PROPERTIES
propTestStep.setPropertyValue("Form Name", a.getContents())
propTestStep.setPropertyValue("PDF", b.getContents())
propTestStep.setPropertyValue("Rendering Engine", c.getContents())
propTestStep.setPropertyValue("make PDFa", d.getContents())
propTestStep.setPropertyValue("PDF type", e.getContents())
propTestStep.setPropertyValue("Md5Digest", f.getContents())
propTestStep.setPropertyValue("responseFile", g.getContents())
// CAPTURING PDF FILE NAME FROM EXCEL AND ASSIGNING FULL PATH TO VARIABLE "PATH"
String p1 = testRunner.testCase.testSuite.project.getPropertyValue("InputFolder")
String p2 = "Input_PDF"
p3 = propTestStep.getPropertyValue( "PDF" )
p4 = p1 + "\\" + p2 + "\\" + p3
propTestStep.setPropertyValue("Path",p4)
path = propTestStep.getPropertyValue ("Path")
// ENCODING PDF FILE INTO BASE64 FORMAT
def inputFile = new File(path).getText('UTF-8')
String encoded = inputFile.bytes.encodeBase64().toString()
propTestStep.setPropertyValue("PDFcontent", encoded)
propTestStep.setPropertyValue("Count", next.toString()) // increase Count value
next++ // increase next value
propTestStep.setPropertyValue("Next", next.toString()) // save Next value in properties
// SETTING STOP VALUE
if (counter == size-1)
{
propTestStep.setPropertyValue("Stop", "T")
}
else if (counter==0)
{
def runner = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner(testRunner.testCase, null)
propTestStep.setPropertyValue("Stop", "F")
}
else
{
propTestStep.setPropertyValue("Stop", "F")
}
- nmrao8 years agoCommunity HeroWhere is this class - ExtendedError.java? See line number 20.
The stack trace does not seem to related to script. - nmrao8 years agoCommunity HeroDo you have any boolean data in the spread sheet?
- Radford8 years agoSuper Contributor
I'm grasping at straws a bit here, but picking up on what nmrao has pointed out about the stack trace line:
at com.ubs.soapuiengine.ExtendedError.afterStep(ExtendedError.java:20)
While I do not recognise the begining "com.ubs.soapuiengine.ExtendedError", the "afterStep" part did make me think about custom event handlers, do you have any of these setp up? Here's their documentation page:
https://www.soapui.org/scripting---properties/custom-event-handlers.html
(I've linked to the old docs page as from your screenshot you seem to be using an old version of SoapUI Pro, the Ready API docs can be found here).