Closed mverma-va closed 10 years ago
I created a POST request in Postman which had URL parameters and form-data. The response was correct. After saving the collection, and running in Newman, all tests were still running. For you, are the tests failing, or is it something else?
Yes, my tests are failing only when I run them through Newman, works with collection runner. What I am doing with my TEST scripts is that I am storing some id's from response body of previous calls to env. var and using them in future calls(to make data dynamic, that could be the reason too) var retData = JSON.parse(responseBody); postman.setEnvironmentVariable("agid", retData.data.agid);
So after fetching this agid, I am using it in the delete call (as in earlier snapshot), so is that the reason. If you see the current attached snapshot, it works fine if I move the form-data to url params.
Will have to look into this...thanks for pointing it out.
Also noticed with Newman, that this works fine in form-data when I hard coded the variable "agid" to some value, but failed when I used as env variable "{{agid}}". So it seems POST calls are working with form-data, but it is just those env. variables not working in form-data.
This has been fixed - we'll push a new release this week.
We've pushed new release - 1.0.7. Can you mark this as closed?
This is working fine now, thanks for the quick fix :)
Noticed that POST calls with form-data fields does not work with Newman(command line), but the same works with collection Runner. I have confirmed the behavior, if I move the form-fields to the URL-params section, it works with Newman(command line).