Environment variables are updating but newman run take the initial value

I’m using this command to run - newman run “D:\enterprise-api\Test-Automation\collections\collectionTest.postman_collection.json” \ -e “D:\enterprise-api\Test-Automation\collections\generate.postman_environment.json” \ -g “D:\enterprise-api\Test-Automation\collections\workspace.postman_globals.json” \ –reporters cli,htmlextra \ --reporter-htmlextra-export ./reports/report.html \ --insecure --verbose --reporter-htmlextra-logs

I deployed my project with jenkins. I want to see the updated env var value for inital/current to repetitive usages.

Why newman does not take updated value. how can I solve it?

{I have file uplod apis. after uploading files i want to store the count. I saved that counts & file paths in a env var. then need to use in another apis}

Hey @pdulmi :wave:t2:

Welcome to the Postman Community :postman:

Newman or anything that isn’t the UI, doesn’t know what those current values are as those are not part of the exported file or synced.

You can open the environment or global in a text editor to see that. It will only show the value of the initial values.

There are Newman flags to export the final variables but I’m not sure if that’s what you’re after:

--export-environment <path>
The path to the file where Newman will output the final environment variables file before completing a run.

--export-globals <path>
The path to the file where Newman will output the final global variables file before completing a run.

Are you using the counts and file paths in the same Collection/Newman run?

Hey @danny-dainton

Thank you,
Yes I’m using all in same collection.
This is how my env vars.