Contributions
Re: SoapUI Teardown Script
Thanks again, This is the request file stored in my case. CLI tage should have proper telephone number <OrderLookupRequestInput> <CLI>${#TestCase#CLI}</CLI> <EarlyDaysDuration>0</EarlyDaysDuration> <EarlyDaysThreshold>0</EarlyDaysThreshold> <EarlyDaysHours>0</EarlyDaysHours> <InLifeDaysDuration>0</InLifeDaysDuration> <InLifeDaysThreshold>0</InLifeDaysThreshold> <InLifeDaysHours>0</InLifeDaysHours> <CancelledDays>0</CancelledDays> </OrderLookupRequestInput>2.9KViews0likes2CommentsRe: SoapUI Teardown Script
Thanks Rao andRupert, I realy appriciate your response on this. I have supliment question. Actiually I am also storing the request along with the response by using the below code you suggested. But in my request xml , it store the path of custome properties instead of actual value used in the request. Is there anyway I could save the request with actual data. thanks in advanve for your help. import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep def folderPath = 'D:/TearDown/' + testSuite.name + '_' + System.currentTimeMillis() + File.separator new File(folderPath).mkdirs() // for each testCase in the testSuite testSuite.testCases.each { testCaseName, testCase -> // path for this testCase def folderPathSuite = folderPath + testCaseName + File.separator new File(folderPathSuite).mkdir() // for each testStep testCase.testSteps.each { testStepName, testStep -> log.info testStep.class if (testStep.class == WsdlTestRequestStep){ // define a file def file1 = new File(folderPathSuite + testStepName + '_request.xml') def file2 = new File(folderPathSuite + testStepName + '_response.xml') // get the response and write to file file1.write(testStep.getProperty('Request').getValue()) file2.write(testStep.getProperty('Response').getValue()) } } }2.9KViews0likes4CommentsSoapUI Teardown Script
I have found the below teardown script from one the blog to save the request and response in to a folder /files. It works fine when I have only SOAP request stepsbut did not work for other types of steps. I have property transfer, groovt script, JDBC Request, Delay and SOAP request in my steps, but only intrested to record request and response of SOAP Request. // path for the testSuite def folderPath = 'C:/temp/' + testSuite.name + '_' + System.currentTimeMillis() + File.separator new File(folderPath).mkdirs() // for each testCase in the testSuite testSuite.testCases.each { testCaseName, testCase -> // path for this testCase def folderPathSuite = folderPath + testCaseName + File.separator new File(folderPathSuite).mkdir() // for each testStep testCase.testSteps.each { testStepName, testStep -> // define a file def file = new File(folderPathSuite + testStepName + '_response.xml') // get the response and write to file file.write(testStep.getProperty('Response').getValue()) } }2.9KViews0likes7Comments- 791Views0likes0Comments
Conditional and Variable Delay
Hi, Wondering that some experience and inteletual minds could help me on this. I am new to SoapUI and using free version I am writtng a test where I can accorss in a situation to invoke a Soap request which insert this recordinto a database table (let's call Table A). So I am doing this using Soap request step. There is some sort of message brocker which process thisrecordin table A and after processing, another entry made into Table B. I have to call another WS method to validate the response. Currentely I put the normal outof the box delay step and put some delay, but the time our system take to process the first record and insert the entry to table B is variant., some time it take 30 sec and some time mora than 3 minutes, Can I put some kind of conditional and variable delay in which I could keep looking into Table B for a certain record and once available move to the next step other keep looking for a certain time and then fail the step if not found for defined period. If this could possiblle using groovy plz help. Regards,821Views0likes2Commentsjava.lang.NullPointerException when testRunner.runTestStepByName("StepName") used
Hi, I am gettingjava.lang.NullPointerException when I usedtestRunner.runTestStepByName("Update"+requiredField[j]) to run a specific step. The script able to execute the step in test case but through error. Here the copy of script import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner ArrayList ar = new ArrayList() jdbcXml = context.expand('${JDBCRequestForCheckingCommandPropertyID#ResponseAsXml}') def root = new XmlSlurper().parseText(jdbcXml) root.ResultSet.Row.each{row-> ar.add(row["COMMANDPROPERTYID"].toInteger()) } ArrayList requiredField = new ArrayList() requiredField.add(61) requiredField.add(276) requiredField.add(605) for (j=0; j<requiredField.size();j++) { if (ar.contains(requiredField[j])) { testRunner.runTestStepByName("Update"+requiredField[j]) } else { testRunner.runTestStepByName("Add"+requiredField[j]) } } Regards,Solved4.8KViews0likes1CommentRe: Groovy If statement is not behaving as expected
Hurray.... I manage to fixed this by converting the array value into integer Herer is the sample code ArrayList ar = new ArrayList() jdbcXml = context.expand('${JDBCRequestForCheckingCommandPropertyID#ResponseAsXml}') def root = new XmlSlurper().parseText(jdbcXml) root.ResultSet.Row.each{row-> ar.add(row["COMMANDPROPERTYID"].toInteger()) }3.3KViews0likes1Comment