Incorrect environment variable value ("original value") referenced by newman

It appears that Newman is referencing the “initial value” for environment variable values, not the “current value.” This is causing some of my tests to break.

I’ll set the “initial value” to match the “current value” and that will fix the problem temporarily, but then it seems like after a day or so the “initial value” will reset and the tests will break again.

Does anyone know how to resolve this?

Hey @cohen

How are you referencing that environment file in the Newman run command?

Hey @dannydainton, I grab the environment with the -e option. The command looks like this:

$ newman run "<collection_id>?apikey=<api_key>" -e "<environment_id>?apikey=<api_key>"

Anything you have as the current value in the app, is not sync’d to the Postman servers.

It would work fine in the app as that’s you’re current session. If you were to add only a current value and exported that environment as a JSON file, the value would be there either.

You would need to have a value in the initial value for Postman to know what it is and make that available in the environment URL.

What you could do with Newman is to pass the value for an environment in the CLI command.

--env-var "var_name=var_value"

Be doing this, it will resolve the {{var_name}} variable in the collection. This is perfect for sensitive data like passwords and API Keys that you don’t what to sync with the Postman servers.