A known limitation of the Postman Collection Runner is that it can only execute collection in a consecutive way.
This project is a simple implementation of the solution explained in this StackOverflow conversation.
Added a new postman collection that call for a public api: https://openlibrary.org/dev/docs/api/lists so the project can be run right away after checkout.
Here I needed to attack first /api/persons
to get the list of persons ids.
And then /api/persons/:id
for each person in the list.
To do that I used the postman.setNextRequest()
tricks that specify the next request that will be executed in the collection run. And in each run I get the last personId and pop() it from the array in environment variables.
And save the files in a postman/
directory.
Simply run npm init -y
and install the 3 dependencies: npm i async newman path newman-reporter-html
Specify the number of concurrent run, iterations inside each of them, the path for your postman collection and environment execute the script with
npm start [NumberOfRuns] [NumberOfIterations] [Collection] [Environment]
npm start 2 2 'postman/postman_collection_open_source.json' 'postman/localhost.postman_environment.json'