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.
Hello everyone,
I’m encountering an issue when running my Postman collection via Newman, alongside some Playwright tests, from the command line. I’m a QA engineer, setting up basic CRUD tests using both Newman and Playwright to validate API functionality and its frontend representation.
Collection Structure
Here’s the structure of my Postman collection, where I save variables to use across different requests:
Postman Collection (QA)
- Create Item (Folder)
- POST Get Bearer Token: Retrieves an authentication token.
- POST Create Item: Creates an item, and the
idfrom this response is saved as a variable.
- Update Item (Folder)
- PATCH Update Item: Uses the previously saved
idvariable in the URL to update the item.
- PATCH Update Item: Uses the previously saved
- Delete Item (Folder)
- DELETE Delete Item: Deletes the item using the
idvariable saved from the Create request.
- DELETE Delete Item: Deletes the item using the
Execution Flow
I export this collection and run it from a batch script, which includes Playwright tests to validate frontend actions between each request. The batch script mirrors the collection structure, running Playwright tests after each API call to check frontend accuracy.
Issue
When I run this setup via Newman, the id variable saved during the “Create Item” step does not seem to be retained by the time it’s used in the “Update Item” request. This works perfectly when running the collection in Postman manually but fails when run via Newman.
Any insights on why the id variable might not be persisting across requests in Newman, or tips on troubleshooting this setup, would be greatly appreciated!
Thank you!