Create time out scenario in SOAPUI

pankaj_ar picture pankaj_ar · Sep 3, 2012 · Viewed 25.5k times · Source

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?

Answer

Chris Thornton picture Chris Thornton · Sep 5, 2012

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.