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.
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.