Contributions
How do I run a test step from a LoadUI teardown script?
I have a LoadUI (3.3.0) suite that sometimes causes data to be left in the database after it's been run. I'd like to add a teardown script to call a DELETE API to clean up after the performance test. I tried this: testSuite().getTestCaseByName("cleanup").getTestStepByName("DELETE objects").run(runner, context) but when I try to run it I get this error in the log: Caused by: groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.WsdlTestSuitePro.call() is applicable for argument types: () values: [] I don't know what's attempting to call that method. What do I need to do to get this working?533Views0likes0CommentsGroovyUtils.projectPath differs depending on context?
I have a SoapUI project that runs fine from the GUI, but if I try to run the test case from Java, it seems that the project path that GroovyUtils returns is empty. In my Groovy script I have this code: groovyUtils = new com.eviware.soapui.support.GroovyUtils(context) log.info groovyUtils.projectPath When I run this script in SoapUI, I get a full path to my project: Wed Oct 25 16:13:06 CDT 2017:INFO:C:\Users\me\Documents\project_folder But when I call the Test Case from Java, the global-groovy.log file has 2017-10-25 16:05:50,665 INFO [log] It seems to be that the project path is empty when run from Java. If that's the case, how can I fix this?1KViews0likes1CommentGetting 500 when running a test step from Java
I have a test suite with one test case which has three test steps. I can run the first test step from SoapUI just fine, but when I load the project from a Java class, I see debug messages with an HTTP 500 and a strange connection IP. Then there's an IOException. Here's my code: WsdlProject project = new WsdlProject("Resources/SOAPService-soapui-project.xml"); WsdlTestCase testCase = project.getTestSuiteByName("TestSuite 1").getTestCaseByName("TestCase 1"); WsdlTestStep driver = testCase.getTestStepByName("Driver"); StringToObjectMap properties = new StringToObjectMap(); properties.put("requestBody", null); properties.put("expectedVendorCode", null); properties.put("expectedInternalCode", null); properties.put("currentTime", null); WsdlTestCaseRunner runner = new WsdlTestCaseRunner(testCase, properties); runner.runTestStep(driver); Here's the log and stack trace: [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: POST /web_services/services/specific_service HTTP/1.1 [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 500 Internal Server Error [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Connection 0.0.0.0:65124<->216.58.218.206:80 shut down [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Connection 0.0.0.0:65124<->216.58.218.206:80 closed java.io.IOException: Decompression of response failed at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpMethodSupport.getResponseBody(HttpMethodSupport.java:321) at com.eviware.soapui.impl.wsdl.submit.transports.http.support.methods.ExtendedPostMethod.getResponseBody(ExtendedPostMethod.java:133) at com.eviware.soapui.impl.wsdl.submit.transports.http.BaseHttpResponse.<init>(BaseHttpResponse.java:92) at com.eviware.soapui.impl.wsdl.submit.transports.http.SinglePartHttpResponse.<init>(SinglePartHttpResponse.java:46) at com.eviware.soapui.impl.wsdl.submit.transports.http.support.attachments.WsdlSinglePartHttpResponse.<init>(WsdlSinglePartHttpResponse.java:40) at com.eviware.soapui.impl.wsdl.submit.filters.HttpPackagingResponseFilter.wsdlRequest(HttpPackagingResponseFilter.java:75) at com.eviware.soapui.impl.wsdl.submit.filters.HttpPackagingResponseFilter.afterAbstractHttpResponse(HttpPackagingResponseFilter.java:52) at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.afterRequest(AbstractRequestFilter.java:68) at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:295) at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:127) at com.eviware.soapui.impl.wsdl.WsdlSubmit.submitRequest(WsdlSubmit.java:80) at com.eviware.soapui.impl.wsdl.WsdlRequest.submit(WsdlRequest.java:242) at com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.run(WsdlTestRequestStep.java:419) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:239) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStepByName(AbstractTestCaseRunner.java:224) at com.eviware.soapui.model.testsuite.TestCaseRunner$runTestStepByName.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at Script1.run(Script1.groovy:11) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:100) at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:154) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:239) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:229) at futzing.SoapUIRunner.main(SoapUIRunner.java:32) What am I missing in the setup?1.2KViews0likes0CommentsgetContentAsXml() gives null pointer
I have a fairly simple test case with three test steps: Groovy script that acts as a driver, calling the other two steps as necessary. Request step A Request step B The driver calls request step A, does some processing, then calls step B. If I run the driver by itself, everything is fine. But if I execute the test case, the driver crashes when trying to parse the response from step A. Here is how I'm getting the response content: responseXml = testRunner.runTestStepByName("MarketTimeRequest").getResponse() responseBody = new XmlSlurper().parseText(responseXml.getContentAsXml()).Body When I run the test case, I get a NullPointerException at responseXml.getContentAsXml(), with the message "Cannot invoke ... on null object". Why would the responseXml be null when running the test case, but not when running the driver?1.6KViews0likes1CommentRe: TestSteps not executing in correct order
I can't show a screenshot of the test case since it might have proprietary information; same with the groovy script. I can give an example, though: TestCase: Groovy script step Request step Groovy script: new File(/path/to/file/).splitEachLine(',') { items -> first_part = items[0] second_part = items[1] // do some processing on the parts testRunner.runTestStepByName("Request step") } This script is what I mean by the groovy driver. One of my colleagues said it might be the case that the test case's log shows when a step is finished, as opposed to when it starts (which is what I thought the log showed).1.5KViews0likes0CommentsTestSteps not executing in correct order
I have a pretty simple test case that has a Groovy driver (step 1) and one request step (step 2). The driver reads a file and runs the request step once for each line in the file. However, when I run the test case, I see the request step execute first, then the Groovy step, then the request step again (for a file with only one line). If I try a file with two lines, the TestCase log reads step 1 [request step] step 2 [request step] step 3 [driver step] step 4 [request step] What on earth is going on? This is v5.0.0.1.6KViews0likes2CommentsUse lines from a file as SOAP request bodies
I have a file which has one chunk of XML (representing the body of a SOAP request) per line. I want to be able to have SoapUI hit an API with requests built from each line of that file. I tried doing this in my Groovy script step: new File('test_file').eachLine { {line -> context.setProperty("requestBody", line) testRunner.runTestStepByName("RequestStep") } } My TestCase has the Groovy script step followed by the RequestStep, but all I see in the console when I run the TestCase is Test started at 2017-09-06 13:27:40.729 Step 1 [Driver] OK: took 18 ms -> Script-result: Script16$_run_closure1_closure2@3be77f1 TestCase finished with status [FINISHED], time taken = 74 Step 2 [RequestStep] OK: took 56 ms It seems that the steps are not looping properly. Is there a way to do this?1.3KViews0likes0Comments