Newman - Running Tests

Archived topic — this may be out of date.
Newman has been replaced by the Postman CLI, Postman’s official, signed command-line tool. It runs collections as Newman did, and also lints API specs, runs mocks and monitors, and syncs local files with Postman from your terminal, CI/CD pipeline or coding agent.
Working with an AI coding agent? The Postman plugin lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.
For current help, see the Postman docs, try the free Postman tools (no account needed), or join us on Discord.

What would be the ideal situation in Newman to run a test which resulted in a variable and later use that variable in other tests. I know it is not hard with collections or environment variables in Postman, but is there any better way to communicate?

Please note: For some reason you’re forbidden from using the Postman API.

What kind of options are you looking for? The best practice is typically to use variables for requesting chaining.

Thanks Allen, I will try Chaining, just checking how about setting the respective value as a global variable (for example) and export the global to a file. Later import the global into the next collection run. What do you think about this approach?

Oh ok, I didn’t understand that’s what you were trying to do.

If you are giving is a local file, you can use the flag --export-globals to overwrite it with the values after the collection run.

So your command would be

newman run myCollection.json --globals globals.json --export-globals globals.json

Here is the documentation for newman command line arguments