Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create time out scenario in SOAPUI

Tags:

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?

like image 504
pankaj_ar Avatar asked Sep 03 '12 06:09

pankaj_ar


People also ask

How do I set timeout in SOAPUi?

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.

How do I create a fault response in SOAPUi?

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.

How can create mock service in SOAPUi without WSDL?

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!

How do I change the mock service port in SOAPUi?

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.


2 Answers

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.

like image 56
Chris Thornton Avatar answered Sep 23 '22 19:09

Chris Thornton


Select your response in the tree. Then at the bottom in "MockResponse Properties" look for: Look For this

like image 38
Federico Martinez Avatar answered Sep 24 '22 19:09

Federico Martinez