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.
Your question may already have an answer on the community forum. Please search for related topics, and then read through the guidelines before creating a new topic.
Here’s an outline with best practices for making your inquiry.
My question: I’ve tested some APIs in Postman and all the tests are passed and got 200 for each request. But when I tried to run the same collection in CMD, I’m getting 400 Bad Request. I used the link and also exported the collection to run it in CMD but it gives the same 400 bad request in both methods. is there any other method to run collections using newman?
Details (like screenshots):
How I found the problem:
I’ve already tried: used JSON link from the postman to run collection in CMD and used exported file to run collection in CMD
I’m guessing this is it. You prob have ContactId set in your environment, but not in the environment you’re passing in the terminal.
I’d also suggest trying newman-reporter-htmlextra - npm. It generates a very detailed html report so you can look at all of the details of the request and response. It makes troubleshooting a lot easier.
Thank you for the response.
I identified the issue here which is i am not getting the variable from Environment and i was trying to get it from global variables.
Then i tried to set an environment variable but it is not creating an environment variable . i attach the response and the script in this reply , could you please support me to find the issue here.
Thank you.
Yes i noticed the mistake and i was tried to getting the variable from global’s which is not correct.
I also generated htmlextra reports for troubleshooting .
But right now i’m getting another issue which is cannot set an environment variable using response data.
Thank you very much again, i really appreciate your support regards this manner and i found the issue with it. i made a mistake in the beginning “Didn’t create an environment variable to store my variables”.
Now it works smoothly.