I am working on a web-project. I have created one Http Url Connection. But for that, I have to test the code for time-out InterruptedIOException, that will execute on time-out, but even after setting time-out time as 1msec, my case is executed successfully.
How can I make delay from SOAPUI, so that I can have time-out successfull?
In ReadyAPI or SoapUI: Double-click the test case in the Navigator to open the test case editor. Click Preferences on the toolbar of the test case editor. Specify the Test Case Timeout, in milliseconds, and click OK.
1) We can add one more mock response and set a dynamic response based on the request/query or send a response either in sequence or randomly. 2) To add a new mock response, right click on the mock operation and select New Mock Response. 3) Now in New Mock Response2, you can create soap fault response, if required.
You can just trick SOAPUi with some dummy WSDL, at least with a single request/response definition! Just replace the requests it generates with the XML document you wanted. You an also add additional requests with entirely different request/responses by copy and pasting!
We can change the port as we need by clicking the wheel button in the mock service window and change the value. Open the setting by clicking the wheel icon, which will pop up the setting options. Change the port as you want here. You can even add base context path to mock API here if needed.
If you want to test how a client will react to a timeout, create a mockservice in SoapUI, and have it execute an OnRequest script prior to returning the (usually pre-determined) response. The script can be as simple as:
sleep(60000)
This would give you a 60-second delay before responding.
Select your response in the tree. Then at the bottom in "MockResponse Properties" look for:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With