How to add delay in SoapUI Response

  • 12 September 2016
  • ADM

 

How to add delay in SoapUI Response - images/logos/soapui.jpg

 

From my point of view, SoapUI is the most powerful test tools for Web Services. When you need to add a delay on your mock service response to simulate a long process or a timeout, you can easily do this by following the steps below.

Step 1

Open Mock Service Windows.

How to add delay in SoapUI Response - /images/SoapUIDelay.png

Step 2

Add the following code on AfterRequest Script section:

def timeout = 10000 // in milliseconds
Thread.sleep(timeout)

Step 3

Test the service by doing a request and measure the response time.

 

References