Pre-request script not incrementing an environment variable during Performance test

Hi,

Trying to increment an environment variable in Pre-request. The script at the Collection level.

When I run it functional it works but it doesn’t when run it in Performance mode.

Thanks.

If I remember rightly, the environment variables are read only in performance mode. They run from the Postman cloud and has limited access to your environment. It can only read the initial value, not the current value. Not sure how you get around this.

I think I’ve seen examples that use the Postman API to updated the environment directly, but that would probably mess up the performance test as the time taken to process that additional API request would be included in the performance figures.

The following explains how to randomize requests.

Use a data file to simulate virtual users | Postman Docs