Hi all, I am new to postman and I have a requirement to send a http request to create a multiple variables in a single aspect.
ie: one aspect has many variables.
for your information: to create something new in the server I have to use PUT method. And it worked fine.
so when I use this file to run the collection using Runner , It was only created one object. (json file has 3 objects) other two objects are not created.
The moment you upload the JSON file, the collection runner reads the number of entries that are there and sets the iteration count, like so:
Then as soon as you press Run, each request will now run for 3 times in succession, and data for each iteration will be passed accordingly.
Question is, when you run your collection do you see these iterations being performed?
When you upload the data file, do you see the iteration count set as 3?
If not, can you make it 3 and check?
That’s correct, that means runner is providing the correct data and running the correct number of iterations for your request.
Can you check the runner view?
It should look something like this (Showing the iterations distinctly):
As I can see in the image that you shared, you’re getting a 402 - Precondition Failed error.
This error is being thrown by the server, you should check the server code as to why this is failing.
For more help, you can use the Postman Console to view each request being sent out in a separate view.
To open the Postman Console - View > Show Postman Console
It seems like variables array index always showing 0. It should something like 0,1,2 , is it ?
if that’s the case how can I write a pre-request-test to loop through the json file , if possible ?
server code is out of my control! I’m using thier apis.
then array only has only one item which can be accessed using the 0th index.
That’s why the index won’t change in the iterations because it’s just a view which is listing the items in the array, irrespective of anything going to the server.
Also, the data from Postman is going as expected as I can see from the screenshot.
You should read the error message in the response body if there is any from the api.