Reputation: 2687
I need to make around 100 POST request.
The body of every post request needs to have a different ID.
Sample BODY
{
id: 1,
name: "ABC",
city: "NY"
}
All 100 requests should have different 'id' , but rest of the data can be the same
Can I attain this through Postman ? ..or some other tool?
Tried:
Assigned value to a variable, and used that as value for ID in Postman, but unable to change this variable for every request
Upvotes: 1
Views: 300
Reputation: 25881
You can add {{$randomInt}}
to the POST body, save that request and then open the Collection Runner.
In the iteration count, type 100 and start the run. That will create a random id value for each request between 1 - 1000. As this is "random" this is the potential for the same value to be sent more than once.
Alternatively, you could add a {{id}}
variable to the POST request body. Then create a CSV file with a single column which has id
as the header - add the ID values you want as 100 new rows in the column.
In the Collection Runner, select the created CSV file and run that with your request.
There are a number of different ways that this can be done, it's just finding the use case that suits your context.
Upvotes: 1
Reputation: 27
You can the pre-request scripts in postman to send multiple request.
You can use
postman.setNextRequest("request_name");
To keep sending request till some condition is reached
Upvotes: 0