Options for passing on a value to the next request

I have HTTP requests to upload a file, download it, delete it. The response to the upload request contains a file ID and this ID should be used in the the other 2 requests, in order to deal with the same file.
I achieve this by updating an environment variable for the file ID after the response to the 1st request is received.
The other 2 requests read this env variable’s value and use this.
If I use the collection runner, it works fine.

When I do a performance test with several virtual users, I think there’s a mess up, because the file ID in the env variable could be changed by another virtual user. This leads to response codes of 404, 400, etc.

I understand that Flows could be used to pass on values from one response to another.
My questions are: Can I use Flows to perform performance tests with several virtual users?
Which other alternatives do I have?

Hi @sunkad. Welcome to the Postman Community!

If I understand you correctly, what you’re communicating here is that during performance tests, environments and variables should be isolated to each virtual user. In your case, for every run, this environment is being updated by multiple virtual users and causing the values to be inconsistent. Is this correct?

Hi. Thank you for your response.
Yes, you’ve summarized it correctly.
Correction: Not ‘environments and variables’, but ‘environment variables’.
If I can find a way to isolate them for each virtual user, that would work.
I’m wondering what the solution could be, or what alternatives I have.

hey @sunkad You can use collection variables to achieve the above. Collection variable will be localized to each run for each VU.

1 Like

I would also love to talk to you more about your feedback on performance testing. Let me know if you are willing to…

1 Like

That’s an excellent tip! Thank you so much Malvika. I’ll try it out.

Yes, we could do that. It might be a while before I get back to you though.

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