Those who are involved in API or web service development should be knowing about Postman, it is one of the most popular tools to build API requests and test them.
Collection Runner is one of the feature of Postman. You can create one or more requests and group them in Collection, and as name suggests, you can run the entire collection i.e. series or requests.
What if you need to add “Think Time” or “Delay” or “Pause” between two requests? It is surely possible, here are some options:
- Using Collection Runner GUI
- This option will be applicable to all the requests in the collection
- In the Collection Runner window, enter value for Delay in milliseconds
- Using Command Line
- Using Script
- This option can be used in individual requests
- You can configure different Delay values for individual requests
- To configure the delay, you have two options:
- Delay before executing the request
- Select individual request
- Click on “Pre-request Script” section
- Include this function: setTimeout(function(){}, [number]);
- Replace [number] with time in milliseconds
- Delay after executing the request
- Select individual request
- Click on “Tests” section
- Include this function: setTimeout(function(){}, [number]);
- Replace [number] with time in milliseconds
- Delay before executing the request