Monday, July 13, 2015

In this post I will explain you how to add a delay to a response when working with mock services in SOAPUI. This is quit simple, in-order to create a SOAP UI mock service you follow this guide. After creating a mock service do the following to add a delay to the response.

1. Open The mock service and click on the specific action  and open the response tab as shown below.



2. Now from dispatch option select Script option.


3. Now add the following code to the content. Please note that I'm using groovy as the scripting language and you can change this from settings.

Thread.sleep(5000)





You can change the delay by changing the value note that the value is specified in milliseconds. This will add a delay to the response. :)



Categories:

3 comments:

Subscribe to RSS Feed Follow me on Twitter!