# Performance Testing Script Issue In Postman

**URL:** <https://community.postman.com/t/performance-testing-script-issue-in-postman/79034>\
**Category:** Help Hub\
**Tags:** collections, testing, performance\
**Created:** [April 22, 2025, 11:46am UTC](https://community.postman.com/t/performance-testing-script-issue-in-postman/79034 "2025-04-22T11:46:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![orbital-module-par10](https://avatars.discourse-cdn.com/v4/letter/o/e47c2d/32.png) [@orbital-module-par10](https://community.postman.com/u/orbital-module-par10)\
**Post date:** [April 22, 2025, 11:46am UTC](https://community.postman.com/t/performance-testing-script-issue-in-postman/79034/1 "2025-04-22T11:46:13Z")

</div>

Hi,

I am trying to use performance testing feature in Postman. So, I have collection and inside collection I have endpoints, and in collection, inside Pre-request, I have written script to add request headers before making requests. When I run my collection by using collection runner, and choose functional testing, everything works fine, I get success response. But, when I choose performance testing and run it, I get 100% error. I checked the Errors section, and there I see that, the script inside the collection that is responsible for adding request headers before sending the request is not getting implemented as there is no headers applied for the requests made in performance testing.

So, to be clear, I follow same 2 exact steps, for one, I choose functional, everything works fine, script is getting implemented, headers are getting added etc. In Performance testing, script is getting ignored and I get 404

---

<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:** [April 22, 2025, 6:41pm UTC](https://community.postman.com/t/performance-testing-script-issue-in-postman/79034/2 "2025-04-22T18:41:00Z")

</div>

Hey @orbital-module-par10 👋🏼

Welcome to the Postman Community :postman:

Could you share more details about the request structure, please? A visual example would be best.

A 404 would suggest the route isn’t found, what is the header that’s getting applied?

Is that determining the part of the URL?

---

<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:** [April 23, 2025, 11:30am UTC](https://community.postman.com/t/performance-testing-script-issue-in-postman/79034/3 "2025-04-23T11:30:49Z")

</div>

Hey @orbital-module-par10 👋

I set up a dummy Performance Testing run using the [RequestBin](https://requestbin.whapi.cloud/) service to see the _Pre-Request Script_ getting executed as part of the run.

A basic script to set a random word to use in the request body:

 ![Screenshot 2025-04-23 at 12.20.01](https://us1.discourse-cdn.com/getpostman/original/3X/3/f/3fc48f084865f6e491c53f5bce8aae760240c9f5.png)

Setting the variable syntax in the request body which will resolve to the created random word:

 ![Screenshot 2025-04-23 at 12.20.08](https://us1.discourse-cdn.com/getpostman/original/3X/5/d/5dac0ea57260a0d018ebaed98a565de8eb177941.png)

The Collection being run in a Performance Test:

 ![Screenshot 2025-04-23 at 12.21.43](https://us1.discourse-cdn.com/getpostman/original/3X/7/5/758ca3b903139a5f8a471257a089956236209dd1.png)

The service receiving the request with the resolved variable in the request body:

 ![Screenshot 2025-04-23 at 12.21.14](https://us1.discourse-cdn.com/getpostman/original/3X/a/a/aa3f66efcb05f3e4650b111b767f46d7f31a6db4.png)

Adding scripts to a request and executing them during a Performance Run is working as expected, this is a very basic example so there might be other things happening on your side which are causing the issues for you.

---

<div class="post-metadata">

**Author:** ![orbital-module-par10](https://avatars.discourse-cdn.com/v4/letter/o/e47c2d/32.png) [@orbital-module-par10](https://community.postman.com/u/orbital-module-par10)\
**Post date:** [April 23, 2025, 1:28pm UTC](https://community.postman.com/t/performance-testing-script-issue-in-postman/79034/4 "2025-04-23T13:28:42Z")

</div>

Hi, Danny, Thanks a lo for helping.

so I will explain my case. This is the script I use in Pre-request tab for the endpoint:

 ![Screenshot 2025-04-23 145544](https://us1.discourse-cdn.com/getpostman/original/3X/5/d/5d806c23cef2cf846726c74f6db5066a277d0dae.png)

As you can see, it gets some variables from vault. And for now, I changed some values, so when I make normal request, I get 404, but the headers are getting added into the request header.  
This is some part of request header I got from postman:

 ![Screenshot 2025-04-23 145754](https://us1.discourse-cdn.com/getpostman/original/3X/6/9/69e9535646adfd8a4e3047b3c822801027e0ff0a.png)

As you can see, script successfully read the object and add relevant headers.

Now, when I use performance testing, I again get 404 but when I check request headers by navigating to Errors tab, I can’t see the same headers in the request.

I also checked your example, and yes, it worked, successfully adding randomword when making request in performance test, but in my case, headers are not getting added

---

<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:** [April 23, 2025, 1:59pm UTC](https://community.postman.com/t/performance-testing-script-issue-in-postman/79034/5 "2025-04-23T13:59:25Z")

</div>

Thank you @orbital-module-par10

The additional information here about what your script is actually doing is very helpful as now we also know that the Postman Vault is part of the script, it’s not just a simple case of adding headers to a request.

Let me take a closer look at this about get back to you with some answers.

---

<div class="post-metadata">

**Author:** ![orbital-module-par10](https://avatars.discourse-cdn.com/v4/letter/o/e47c2d/32.png) [@orbital-module-par10](https://community.postman.com/u/orbital-module-par10)\
**Post date:** [April 23, 2025, 2:14pm UTC](https://community.postman.com/t/performance-testing-script-issue-in-postman/79034/6 "2025-04-23T14:14:07Z")

</div>

Yeah, I also first thought it is related to using vault, but the thing is even the static values like Project-Name is not getting added into the header, so it is not only about vault variables, but overall headers object is getting ignored
