ContributionsMost RecentMost LikesSolutionsRe: Test case run fails if Properties were set in test step 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") } Re: Test case run fails if Properties were set in test step Radford Unfortunately the only error message I'm getting from the logs so far is only this one: TestCase failed [java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean:java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean], time taken = 2447 nmrao Thank you for your input, however the issue is not in the clearing properties itself, but with assigning value to them. If I put values manually (any number, basically) in the properties - test case is running absolutely ok. Every time I use my script that first clears all properties and then assigns "1" to those two properties - test case fails on the very first step with the exception (screenshot attached). My guess was that it's connected to the types of properties, because as far as I know, you cannot store int or booleans in properties, only converting them to String helps. But i's just a pure guessing, unfortunately I'm not very familiar with SoapUI yet, just started to work with it, so please exuse me for any stupid questions that might come up. Re: Test case run fails if Properties were set in test step Hi Rao, Sure, here's the script that erases values of properties in the test case: stopp = propTestStep.getPropertyValue("Stop") if (stopp == "T"){ def p = myTestCase.testSteps["Properties"] String[] properties = new String[p.getPropertyCount()] properties = p.getPropertyNames() for (int i=0; i<properties.size();i++){ p.setPropertyValue(properties[i], "") } propTestStep.setPropertyValue("Count", "1") propTestStep.setPropertyValue("keyValue", "1") } Test case run fails if Properties were set in test step Dear all, I'm facing one issue with Properties values. There're two properties that I'm using for iterations. If I set the value manually before the run - test case goes smoothly. I added small script at the end of test case to clear all properties and set values for those two mentioned above: propTestStep.setPropertyValue("Count", "1") propTestStep.setPropertyValue("keyValue", "1") Script is working correctly, properties being cleared and Count and keyValue indeed have "1" value assigned, BUT... if I try to run test case one more time - it fails in the very beginning with java.lang.ClassCastException: TestCase failed [java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean:java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean], time taken = 2447 Any suggestions? Many thanks in advance, Olga