simple scripting in a Mock Service - no longer works
I have a problem with Mock Service scripting. It used to work. Now it doesn't. In a previous project (about a year ago) I used simple scripting in a soapUI Mock Service. I had several responses defined for a method. For one of my tests, I wanted to ensure that a subset of the responses would be returned in a specific sequence when the method was called repeatedly by the client piece. There was nothing fancy about this - no conditional programming, just a specification of which named responses I wanted to be sent back to the client. I have had to re-visit this project to fix a small bug and I wanted to do a similar test. However the scripting no longer works. Effectively I have the following responses in the Mock Responses panel of my Login method:- Login_Response_OKAY_1 Login_Response_OKAY_2 Login_Response_OKAY_3 Login_Response_OKAY_4 Login_Response_ERROR In the Dispatch dropdown list I have "SCRIPT" selected. In the Default Response dropdown list I have "Login_Response_ERROR" selected. In the panel below this I have the following script:- return "Login_Response_OKAY_2" return "Login_Response_OKAY_1" return "Login_Response_OKAY_3" return "Login_Response_OKAY_4" In this test I did not want the fifth variant of the response (the error case) sent back. This used to work a treat. I used to get the responses in the order as written, and then they would repeat - i.e. 2, 1, 3, 4, 2, 1, 3, 4 etc). Now I just get the first response in the list, namely Login_Response_OKAY_2, repeatedly. I am using soapUI 5.0.0 and I have Groovy specified as the scripting language (I think this is the default). The only difference I can think of between now and a year ago is that I was probably using an earlier version of soapUI. Can someone suggest what is wrong and how to cure this? Thanks.Solved5.6KViews0likes13Comments