# How to add a time sleep between each test when looping through a data file in the Postman collection?

**URL:** <https://community.postman.com/t/how-to-add-a-time-sleep-between-each-test-when-looping-through-a-data-file-in-the-postman-collection/26070>\
**Category:** Help Hub\
**Created:** [July 22, 2021, 2:04pm UTC](https://community.postman.com/t/how-to-add-a-time-sleep-between-each-test-when-looping-through-a-data-file-in-the-postman-collection/26070 "2021-07-22T14:04:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ps198478320](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@ps198478320](https://community.postman.com/u/ps198478320)\
**Post date:** [July 22, 2021, 2:04pm UTC](https://community.postman.com/t/how-to-add-a-time-sleep-between-each-test-when-looping-through-a-data-file-in-the-postman-collection/26070/1 "2021-07-22T14:04:27Z")

</div>

Hi,  
my postman collection use a data file and run tests with each data from the file.  
it works but our internal system is not able to handle too many tests at one time.  
How can i add a time sleep between each test?  
Thank you

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [July 22, 2021, 2:11pm UTC](https://community.postman.com/t/how-to-add-a-time-sleep-between-each-test-when-looping-through-a-data-file-in-the-postman-collection/26070/2 "2021-07-22T14:11:29Z")

</div>

Hey @ps198478320

Could you clarify that you meant _handle too many requests_ rather than handle the tests within the request?

---

<div class="post-metadata">

**Author:** ![ps198478320](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@ps198478320](https://community.postman.com/u/ps198478320)\
**Post date:** [July 22, 2021, 2:13pm UTC](https://community.postman.com/t/how-to-add-a-time-sleep-between-each-test-when-looping-through-a-data-file-in-the-postman-collection/26070/3 "2021-07-22T14:13:33Z")

</div>

yes it’s too many requests rather than tests within the requests.

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [July 22, 2021, 2:17pm UTC](https://community.postman.com/t/how-to-add-a-time-sleep-between-each-test-when-looping-through-a-data-file-in-the-postman-collection/26070/4 "2021-07-22T14:17:17Z")

</div>

Have you tried increasing the number in the `Delay` field?

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/6/6860132ddc1c97efd3634aa0538735b1bdc070a6.png)

This number is in milliseconds so `1000 ms` for `1 second` etc.

---

<div class="post-metadata">

**Author:** ![ps198478320](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@ps198478320](https://community.postman.com/u/ps198478320)\
**Post date:** [July 22, 2021, 2:49pm UTC](https://community.postman.com/t/how-to-add-a-time-sleep-between-each-test-when-looping-through-a-data-file-in-the-postman-collection/26070/5 "2021-07-22T14:49:50Z")

</div>

In fact i wanted to add --delay-request 3000 in newman.sh  
but i don’t know where to add this line.

is itcorrect?  
`output=$(newman run $COLL_PATH --working-dir $WORK_PATH --reporters cli --timeout 800000 --timeout-request 50000 --timeout-script 40000 --delay-request 3000)`

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [July 22, 2021, 3:04pm UTC](https://community.postman.com/t/how-to-add-a-time-sleep-between-each-test-when-looping-through-a-data-file-in-the-postman-collection/26070/6 "2021-07-22T15:04:25Z")

</div>

Looks right to me…

> - `--delay-request`  
> Specify the extent of delay between requests (milliseconds).

> **[GitHub - postmanlabs/newman: Newman is a command-line collection runner for...](https://github.com/postmanlabs/newman#newman-run-collection-file-source-options)**
>
> Newman is a command-line collection runner for Postman - GitHub - postmanlabs/newman: Newman is a command-line collection runner for Postman

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [December 12, 2024, 12:57pm UTC](https://community.postman.com/t/how-to-add-a-time-sleep-between-each-test-when-looping-through-a-data-file-in-the-postman-collection/26070/7 "2024-12-12T12:57:15Z")

</div>

Closed on December 12, 2024, 12:57pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
