Contributions
Setting excepted data to MockService before sending the initial request
Hi, In one of mytest scenarios, a SoapUI REST test step sends a request to REST web service that in turn sends another request (based on the original request) to a SoapUI REST Mock Service. (Note: The test case and REST Mock Service pertinent to the same SoapUI project) In the SoapUI REST Mock Service I need to check an incoming request in order to make sure that this request contains valid data. In generall, I can do it using Groovy script in “OnRequest script” or in “AfterRequest script”. The question is: How I can set (or transfer, or load) expected data to the REST Mock Service before sending initial rest request? Thanks610Views0likes1CommentChanging a value of project/test case property within REST Test Step
Hi, Is it possible to change value of project/test case property within REST Test Step? For example: Custom property “MsgId” with certain initial value defined for SoapUI project. This property can be used a number of times within a body of a REST request for separate (sub-) requests and its value for each (sub-)request should be unique. Simplified example of the REST request body: <ReqSet> <Request1 MsgId=”${#Project#MsgId}” ... /> <Request2 MsgId=”. . .” ... /> <!-- How to change value of MsgId for the Request2? --> <Request3 MsgId=”. . .” ... /> <!-- How to change value of MsgId for the Request3? --> . . . </ReqSet> Note that request 2 and request 3 are not different REST requests, but a part of the same REST request. Any help would be much appreciated. ThanksSolved1.5KViews0likes4CommentsException when running same test case twice
Hi, I have encounter with a very weird problem. I'm running a test case that has the following steps: 1. Send a request to my service 2. Send a 2nd request to the service 3. Mock response test step to receive a request from my service When I run it once, it works well. When I run it for the 2nd time, i get an exception(see below). From now on, it will always fail. If i close SoapUI and re open it, it will work again for the 1st attempt and then fails again from the 2nd try. I've built tons of test cases and now I cant use any of it, since it will only work for 1 attempt :( This is the exception: Wed Jul 20 14:22:44 IDT 2016:ERROR:java.io.UnsupportedEncodingException: java.io.UnsupportedEncodingException: at java.lang.StringCoding.encode(Unknown Source) at java.lang.String.getBytes(Unknown Source) at com.eviware.soapui.impl.support.AbstractMockResponse.writeResponse(AbstractMockResponse.java:338) at com.eviware.soapui.impl.support.AbstractMockResponse.execute(AbstractMockResponse.java:269) at com.eviware.soapui.impl.wsdl.mock.WsdlMockOperation.dispatchRequest(WsdlMockOperation.java:209) at com.eviware.soapui.impl.wsdl.mock.WsdlMockDispatcher.dispatchPostRequest(WsdlMockDispatcher.java:218) at com.eviware.soapui.impl.wsdl.mock.WsdlMockDispatcher.dispatchRequest(WsdlMockDispatcher.java:113) at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:142) at com.eviware.soapui.monitor.JettyMockEngine$ServerHandler.handle(JettyMockEngine.java:604) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Wed Jul 20 14:22:44 IDT 2016:ERROR:com.eviware.soapui.impl.wsdl.mock.DispatchException: Missing operation for soapAction [****my API***] and body element [null] with SOAP Version [SOAP 1.1] com.eviware.soapui.impl.wsdl.mock.DispatchException: Missing operation for soapAction [***my API***] and body element [null] with SOAP Version [SOAP 1.1] at com.eviware.soapui.impl.wsdl.mock.WsdlMockDispatcher.dispatchPostRequest(WsdlMockDispatcher.java:233) at com.eviware.soapui.impl.wsdl.mock.WsdlMockDispatcher.dispatchRequest(WsdlMockDispatcher.java:113) at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:142) at com.eviware.soapui.monitor.JettyMockEngine$ServerHandler.handle(JettyMockEngine.java:604) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) If anyone has an idea what is the problem,please let me know Thanks566Views0likes0CommentsUsing properties from a request with proprty transfer for JSON
Hi, I posted this thread 2 times already and for some reason it doesn't show up afterwards, hope now it will... I'm building a test case for using REST requests. This test case contains sending request to my service, then my service sends a request( that was triggered by the initial request it received) to a mock, which i'm simulating using a mock response test step. I want to be able to use properties between steps, but I've managed to do so only on SOAP test step. For example: 1st step - send a request(JSON) that contains several parameters in the JSON body 2nd step - i want to use one of the parameters from the 1st request(not from the response), in this request. I know how to do it with property transfer step when i use SOAP request, but i wasn't able to understand how to do it for JSON. Can this be done? Thanks.564Views0likes0CommentsRe: Mock Service test step help
Well... i found what the problem was... The problem was that my service sent the request too fast, so by the time the mock step was started the request was already sent. I looked in the properties of the mock step and found a field called "Start Step" which was empty. I selected the 1st step(which is the initial request) and re tested and it works! Thanks a lot for trying to help, and sorry for wasting your time... :(2.6KViews1like1CommentRe: Mock Service test step help
Hi, My test is combined of 2 steps. 1st step is sending the request to my service, the 2nd step is the mock step to receive it. When i launch the test, 1st step is sending the request, i see in my service log that it was sent and the 2nd step in soap ui test is animated, but i don't have the lines you wrote in the log. Which log should I see it in? I have the test log but all i have printed there is the 1st step: Test started at 2016-07-13 14:03:54.571 Step 1 [Heartbeat - Request 1] UNKNOWN: took 16 ms I don't see any other log... Thanks2.6KViews0likes4CommentsRe: Mock Service test step help
Thanks for your reply, but I know that already :) I mention that so it will be clear that when it's the mock running, my service is sending the request successfully, and when it's the mock test step, it fails. But I am not running it on the same time. I have no idea where the problem could be...2.6KViews0likes6Comments- 2.6KViews0likes0Comments