[SoapUI 5.2.1] mockRequest is NULL in REST MockService
I'm using SoapUI 5.2.1 and I have a REST MockService. Whenever I try to implement the following script, I get the NullPointerException . Script: def requestBody = mockRequest.getRequestContent() log.info "Request body: " + requestBody Error: com.eviware.soapui.impl.wsdl.mock.DispatchException: Failed to dispatch using script; java.lang.NullPointerException: Cannot invoke method getRequestContent() on null object This is a very frustating error that I'm continuously getting, and surprisingly there is no helpful solution anywhere. Please Help!!!! PS : I'm trying to get the content of a HTTP GET request.Solved22KViews0likes14CommentsHow i can set header header in multipart/form-data POST request?
When i sent POST request with file and header "Content-Type: multipart/form-data" , and via curl: curl -i -X POST -H "Content-Type: multipart/form-data" -F "file=@/home/Za_Dolber/abon19.txt" http://somehost.somedomain:9876/service/add?ids=1 i see something like this in Wireshark: POST /service/add?ids=1 HTTP/1.1 Host: somehost.somedomain:9876 User-Agent: curl/7.47.0 Accept: */* Content-Length: 200 Expect: 100-continue Content-Type: multipart/form-data; boundary=------------------------c47979a9d477ee1d HTTP/1.1 100 Continue --------------------------c47979a9d477ee1d Content-Disposition: form-data; name="file"; filename="abon19.txt" Content-Type: text/plain 1234567890 --------------------------c47979a9d477ee1d-- HTTP/1.1 200 OK Content-Type: text/plain Content-Length: 2 ok But when i send same request via SoapUI: POST /service/add?ids=1 HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: multipart/form-data; boundary="----=_Part_0_1598092424.1491306778334" MIME-Version: 1.0 Content-Length: 269 Host: somehost.somedomain:9876 Connection: Keep-Alive User-Agent: Apache-HttpClient/4.1.1 (java 1.5) ------=_Part_0_1598092424.1491306778334 Content-Type: text/plain; charset=UTF-8; name=abon18.txt Content-Transfer-Encoding: binary Content-Disposition: form-data; name="abon18.txt"; filename="abon18.txt" 1234567890 ------=_Part_0_1598092424.1491306778334-- HTTP/1.1 400 Bad Request Content-Type: text/plain Content-Length: 47 Bad Request you must specify file with abonents If i try set whole header field in "Headers" i get that header only in first part of request, like this: POST /service/add?ids=1 HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: multipart/form-data; boundary="----=_Part_1_662240902.1491314924683" MIME-Version: 1.0 Content-Disposition: name="file"; filename="abon18.txt" Content-Length: 267 Host: somehost.somedomain:9876 Connection: Keep-Alive User-Agent: Apache-HttpClient/4.1.1 (java 1.5) ------=_Part_1_662240902.1491314924683 Content-Type: text/plain; charset=UTF-8; name=abon18.txt Content-Transfer-Encoding: binary Content-Disposition: form-data; name="abon18.txt"; filename="abon18.txt" 79067212518 ------=_Part_1_662240902.1491314924683-- HTTP/1.1 400 Bad Request Content-Type: text/plain Content-Length: 47 Bad Request you must specify file with abonents How can i change value of "name" field in Content-Disposition header?Solved14KViews0likes2CommentsREST service multipart/mixed request problem
Hi! I want to send the belowmultipart/mixed type of request from SoapUI but I am unable to add the Content-MD5 header to the second part of body.This header is needed, otherwise the request will fail. My question is: How to add custom headers into a part of multipart request body? Raw request taken from Fiddler, when response is OK: POST http://srv2012r2:8080/simo/api/documents HTTP/1.1 ... Content-Type: multipart/mixed; boundary=19D523FB Host: srv2012r2:8080 Content-Length: 11979 Expect: 100-continue --19D523FB Content-Type: application/json { "fields":[{"Key":"e9e269b9-867f-4cf6-946f-db49091cd52d","Value":"Simplest documentever.docx"}], "storageappid":"d9ca0630-e4f8-4112-a411-ff04d89f2225" } --19D523FB Content-Type: application/octet-stream Content-Disposition: attachment; filename="Simplest+document+ever.docx" Content-MD5: EFV8OUymEQRJLoppzOjQ1w== PK ! ߤÒlZ [Content_Types].xml ¢( ´”ËnÂ0E÷•ú‘·Ub袪*‹>–-Ré{Vý’Ǽþ¾QU‘ ... --19D523FB--Solved10KViews0likes10CommentsDynamic date REST parameter?
Is there any way to define a REST parameter that will automatically take like tomorrow's date? I tried this, but don't know what's really possible or what the syntax would be for more complicated steps: ${=import java.util.Calendar; Calendar now=Calendar.getInstance(); now = now.add(Calendar.DATE, 1); new java.text.SimpleDateFormat("yyyy-MM-dd").format(now.getTime())} According to the raw value, "now" is null when now.getTime() is called.Solved7.8KViews0likes7CommentsProperty Transfer failed when run through maven maven build
hello everyone! I need your quick help. I have a problem when i run my little SoapUI Project with cmd (Winodws 10 & SoapUI Verison 5.6.0). My project consists of two calls, where from the response of the first call an attribute into the second call. When I run the test case in SoapUI everything works fine. Now I have saved the project as XML and included it in the build process of my POM. When I start the project via cmd, it also runs the first call and recognizes it as valid. But when the property transfer is pending, it gives the following error: 11:00:43,526 INFO [SoapUITestCaseRunner] running step [Property Transfer] java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.lang.Object.finalize() throws java.lang.Throwable accessible: module java.base does not "opens java.lang" to unnamed module @20890a1a at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199) at java.base/java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java:130) at org.codehaus.groovy.reflection.CachedClass$3$1.run(CachedClass.java:86) at java.base/java.security.AccessController.doPrivileged(AccessController.java:312) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:81) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:79) at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46) at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33) at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:250) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:116) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:79) at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46) at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33) at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:250) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:116) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:79) at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46) at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33) at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:250) at org.codehaus.groovy.reflection.stdclasses.CachedClosureClass.<init>(CachedClosureClass.java:29) at org.codehaus.groovy.reflection.ClassInfo.createCachedClass(ClassInfo.java:269) at org.codehaus.groovy.reflection.ClassInfo.access$400(ClassInfo.java:36) at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:435) at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:426) at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46) at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33) at org.codehaus.groovy.reflection.ClassInfo.getCachedClass(ClassInfo.java:89) at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:107) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerMethods(MetaClassRegistryImpl.java:189) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:93) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:71) at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:33) at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:62) at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32) at net.sf.json.groovy.JsonSlurper.<init>(JsonSlurper.java:46) at net.sf.json.groovy.JsonSlurper.<init>(JsonSlurper.java:43) at com.eviware.soapui.support.JsonUtil.isValidJson(JsonUtil.java:32) at com.eviware.soapui.support.JsonPathFacade.<init>(JsonPathFacade.java:37) at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfer.readSourceValue(PropertyTransfer.java:347) at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfer.transferProperties(PropertyTransfer.java:317) at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfersTestStep.run(PropertyTransfersTestStep.java:125) at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfersTestStep.run(PropertyTransfersTestStep.java:103) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:211) 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.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:831) 11:00:44,278 ERROR [AbstractTestRunner] Exception during Test Execution java.lang.ExceptionInInitializerError at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:62) at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32) at net.sf.json.groovy.JsonSlurper.<init>(JsonSlurper.java:46) at net.sf.json.groovy.JsonSlurper.<init>(JsonSlurper.java:43) at com.eviware.soapui.support.JsonUtil.isValidJson(JsonUtil.java:32) at com.eviware.soapui.support.JsonPathFacade.<init>(JsonPathFacade.java:37) at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfer.readSourceValue(PropertyTransfer.java:347) at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfer.transferProperties(PropertyTransfer.java:317) at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfersTestStep.run(PropertyTransfersTestStep.java:125) at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfersTestStep.run(PropertyTransfersTestStep.java:103) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:211) 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.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:831) Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.lang.Object.finalize() throws java.lang.Throwable accessible: module java.base does not "opens java.lang" to unnamed module @20890a1a at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199) at java.base/java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java:130) at org.codehaus.groovy.reflection.CachedClass$3$1.run(CachedClass.java:86) at java.base/java.security.AccessController.doPrivileged(AccessController.java:312) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:81) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:79) at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46) at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33) at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:250) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:116) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:79) at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46) at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33) at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:250) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:116) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:79) at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46) at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33) at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:250) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerMethods(MetaClassRegistryImpl.java:211) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:101) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:71) at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:33) ... 20 more 11:00:44,331 INFO [SoapUITestCaseRunner] Finished running SoapUI testcase [TestCase - Symptom], time taken: 487ms, status: FAILED 11:00:44,333 INFO [SoapUITestCaseRunner] Project [Project 1] finished with status [FAILED] in 1602ms [ERROR] java.lang.Exception: TestCase [TestCase - Symptom] failed without assertions I also have a sample project without property transfer and everything runs without errors when I start it via the cmd, so it can really only be the property transfer. Have any of you ever had this problem? I really need your help!Solved6.8KViews0likes4CommentsHow can disable SSL certification verification in SoapUI?
Hi, I am asking this question because I encountered an issue while I was using SoapUI tosending a soap/json request to a HTTPS web service API which was installed with an empty issuer CN self-signed certificate at the server side. This is the sample api link: https://gauth.sandbox.genesyscloud.xyz/auth/v3/oauth/token?grant_type=client_credentials&client_id=auth_api_client&client_secret=client123 SoapUI returns following errors after I clicked send request button. The service api response wasn't returned. INFO:Error getting response for [https://auth.sandbox.cloud.xyz.Token:Request 1]; javax.net.ssl.SSLHandshakeException: Failed to parse server certificates ERROR:java.security.cert.CertificateParsingException: Empty issuer DN not allowed in X509Certificates Same api request call works good inPostman as long as I disable its SSL certification verification. In Postman, there is an option "disable SSL certification verification", you can use it to disableSSL certification verification while you are sending a soap/json request to a HTTPS web service API. However, I am not able to find the similar option in SoapUI. Does any one know how todisable SSL certification verification in SoapUI? Or, how can I send request and get its response successfully against aHTTPS web service API which is installed with an empty issuer CN self-signed certificate at its server side? Thank you!6.3KViews0likes2CommentsREST Basic Authentication error at endpoint level
Version 5.2.1 on Windows When I add my HTTP Basic Authentication to individual REST requests, it works fine with my service. When I add the same username and password to my endpoint definition instead, I get an apache.httpclient.ClientProtocolException. Here are the log excerpts (with host names obscured). Note the original project endpoint was localhost:9080 (without authentication required), and the new one with it required is what I'm showing as real-endpoint-server. From SoapUI log: Tue Dec 01 18:35:44 CST 2015:DEBUG:Loading Definition... Tue Dec 01 18:35:44 CST 2015:INFO:Loading schema types from [http://localhost:9080.wadl] Tue Dec 01 18:35:44 CST 2015:INFO:Getting schema http://localhost:9080.wadl Tue Dec 01 18:35:44 CST 2015:DEBUG:Loaded Definition: ok Tue Dec 01 18:36:12 CST 2015:DEBUG:Attempt 1 to execute request Tue Dec 01 18:36:12 CST 2015:DEBUG:Sending request: GET /rbm/vehicle/my-item-number?vin=my-vin HTTP/1.1 Tue Dec 01 18:36:12 CST 2015:DEBUG:Receiving response: HTTP/1.1 401 Not authorized. Authentication required for protected file. Tue Dec 01 18:36:12 CST 2015:DEBUG:Connection can be kept alive indefinitely Tue Dec 01 18:36:12 CST 2015:DEBUG:Target requested authentication Tue Dec 01 18:36:12 CST 2015:DEBUG:Authorization challenge processed Tue Dec 01 18:36:12 CST 2015:DEBUG:Authentication scope: BASIC 'Renew_by_Mail'@real-endpoint-server:443 Tue Dec 01 18:36:12 CST 2015:INFO:real-endpoint-server:443 requires authentication with the realm 'Renew_by_Mail' Tue Dec 01 18:36:12 CST 2015:DEBUG:Found credentials Tue Dec 01 18:36:12 CST 2015:DEBUG:Attempt 2 to execute request Tue Dec 01 18:36:12 CST 2015:DEBUG:Sending request: GET /rbm/vehicle/my-item-number?vin=my-vin HTTP/1.1 Tue Dec 01 18:36:18 CST 2015:DEBUG:Connection closed Tue Dec 01 18:36:18 CST 2015:DEBUG:Connection shut down Tue Dec 01 18:36:18 CST 2015:ERROR:Exception in request: org.apache.http.client.ClientProtocolException Tue Dec 01 18:36:18 CST 2015:ERROR:An error occurred [org.apache.http.client.ClientProtocolException], see error log for details Tue Dec 01 18:36:18 CST 2015:INFO:Error getting response for [http://localhost:9080.vehicle:06975686]; org.apache.http.client.ClientProtocolException From error log: Tue Dec 01 18:36:18 CST 2015:ERROR:org.apache.http.client.ClientProtocolException org.apache.http.client.ClientProtocolException at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:822) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754) at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper.execute(HttpClientSupport.java:233) at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport.execute(HttpClientSupport.java:323) at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.submitRequest(HttpClientRequestTransport.java:290) at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:220) at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:119) 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) Caused by: org.apache.http.ProtocolException: The server failed to respond with a valid HTTP response at org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:109) at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:252) at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:281) at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:247) at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:219) at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$SoapUIHttpRequestExecutor.doReceiveResponse(HttpClientSupport.java:147) at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125) at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820) ... 11 more However, in http log, it does appear that a reasonable-looking reply was returned, along with a 200 response code. Which also matches my server's http log.5.3KViews0likes11CommentsHow to return HTTP status code without description?
Hello everybody, I try to verify a reason for an error . For this I use a mock service and send responses. What I get is an response starting with... HTTP/1.1 202 Accepted What I need is a response starting with ... HTTP/1.1 202 ... without "Accepted" Is ther a chance to get a message like this? Thanks in advance!5.2KViews0likes1CommentJsonSlurplerGetting Error while Parsing the Json Response
I tried tocreate a groovy script to parse the JSON response to a variable using JsonSlurper. Though the response Json is in valid format, i am getting an error def responseContent = testRunner.testCase.testSteps["Neme fof the test step"].testRequest.response.contentAsString def Response = new JsonSlurper().parseText(responseContent) log.info Code Could some one please look into this issue provide me a workaround for this. Thanks in advance5KViews0likes20CommentsGet Soap Response and Soap Requests of all Test Steps in a Testcase
Hi everyone, I started using the free version of SOAP UI recently and was wondering how to properly implement a loop to get the soap Response and Request of every test step and collate them into a file. I also looked into the API documentation but I was lost and I don't know which one to use. Anyway, I was able to retrieve a specific teststep response and request using the code below. def response = context.expand( '${TestStepName#Response}' ) def rawrequest = context.expand( '${TestStepName#RawRequest}' ) def soapresponse = 'c:/users/Desktop/soapoutput/a.doc' def soaprawrequest = 'c:/users/Desktop/soapoutput/b.doc' def f = new File(soapresponse) def g = new File(soaprawrequest) f.write(response, "UTF-8") g.write(rawrequest, "UTF-8") I also searched the net and found this snippet regarding the teststep loop //Define the object for the collection of requests in the soapUI test case def soapuiRequests = testRunner.testCase.getTestStepsOfType(com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep ) //Groovy Script to loop through each requests in the test case. soapuiRequests.each{ //Creating file name using current date and time //Writing soapUI response to the file inputFileResponse.write(context.testCase.getTestStepByName(it.name).getProperty('response').value) //Writing soapUI request to the file inputFileRequest.write(context.testCase.getTestStepByName(it.name).getProperty('request').value) Date startTime = new Date(); def cur_Time = startTime.getMonth() + "_" + startTime.getDate(); cur_Time = cur_Time + "_" + startTime.getHours() + startTime.getMinutes() +startTime.getSeconds() def fileName = it.name + "_" + cur_Time def inputFileRequest = new File("C:/Users/Desktop/soapoutput"+ "Request_" + fileName+".txt") def inputFileResponse = new File("C:/Users/Desktop/soapoutput"+ "Response_" + fileName+".txt") } There were no problems during the execution of the script but the file is not generated. This is the response after execution. Any help will be much appreciated. Just an update, Using the code below I can now extract the soap response from each teststep. Unfortunately this also retrieves the value of "response" from all test steps including groovy step, etc. which results to "null" being displayed in the log output.Also "a.doc" has no content. // This will get the list of all testSteps in the testCase def testSteps = context.testCase.getTestStepList() testSteps.each{ //The variable definition below will loop through the teststep abd retrieve the response def z = context.testCase.getTestStepByName(it.name).getPropertyValue('response') def soapresponse = 'c:/users/Desktop/soapoutput/a.doc' def f = new File(soapresponse) log.info(z) //def soaprawrequest = 'c:/users/Desktop/soapoutput/b.doc' //def g = new File(soaprawrequest) //g.write(rawrequest, "UTF-8") //def zz = context.testCase.getTestStepByName(it.name).getPropertyValue('response') //log.info(zz) }4.1KViews0likes0Comments