378

I want to POST data from the Postman Google Chrome extension.

I want to make 10 requests with different data and it should be at the same time.

Is it possible to do such in Postman?

If yes, can anyone explain to me how can this be achieved?

3
  • Open the folder of the request and click on run you will see an option to choose number of iterations :) Commented Oct 17, 2021 at 14:15
  • Postman is built on electron, which is built on NodeJS. So they share the same limitations. NodeJS can't send multiple requests at the same time because it is a single threaded event loop. This means Postman can't either. Commented Oct 13, 2022 at 2:48
  • 2
    @MohammadAbuSaloum Iterations aren't the same as concurrency. Commented Jun 10, 2024 at 2:21

17 Answers 17

315

I guess there's no such feature in postman as to run concurrent tests.

If I were you, I would consider Apache jMeter, which is used exactly for such scenarios.

Regarding Postman, the only thing that could more or less meet your needs is - Postman Runner. enter image description here There you can specify the details:

  • number of iterations,
  • upload CSV file with data for different test runs, etc.

The runs won't be concurrent, only consecutive.

Do consider jMeter (you might like it).

Sign up to request clarification or add additional context in comments.

6 Comments

The site in Ray's comment has since migrated to Wordpress.com, here is a working link
that's wrong :) because this feature available in postman .. open the folder of the request and click on run you will see an option to choose number of iterations :)
iterations are not requests at the same time ;)
I don't see this anywhere in postman app.
@BishwasMishra You have to "Open new runner tab", it's kind of hidden.
|
293

Postman doesn't do that but you can run multiple curl requests asynchronously in Bash:

curl url1 & curl url2 & curl url3 & ... 

Remember to add an & after each request which means that request should run as an async job.

Postman however can generate curl snippet for your request: https://learning.getpostman.com/docs/postman/sending_api_requests/generate_code_snippets/

7 Comments

This is brilliant - such a simple, great test for true async behavior.
This is the best solution
what if I need thousands of requests instead?
@giahuy you can call it in a bash loop as many times as needed: for i in {1..100} do curl url & done
Saved me a lot of time, thanks!
|
63

I don't know if this question is still relevant, but there is such possibility in Postman now. They added it a few months ago.

All you need is create simple .js file and run it via node.js. It looks like this:

var path = require('path'), async = require('async'), //https://www.npmjs.com/package/async newman = require('newman'), parametersForTestRun = { collection: path.join(__dirname, 'postman_collection.json'), // your collection environment: path.join(__dirname, 'postman_environment.json'), //your env }; parallelCollectionRun = function(done) { newman.run(parametersForTestRun, done); }; // Runs the Postman sample collection thrice, in parallel. async.parallel([ parallelCollectionRun, parallelCollectionRun, parallelCollectionRun ], function(err, results) { err && console.error(err); results.forEach(function(result) { var failures = result.run.failures; console.info(failures.length ? JSON.stringify(failures.failures, null, 2) : `${result.collection.name} ran successfully.`); }); }); 

Then just run this .js file ('node fileName.js' in cmd).

More details here

6 Comments

Is there a way to achieve concurrent request testing with the postman ui too without using the command-line tool newman?
So tried this code and it worked to run the SAME collection_A; but what if I have 2 different collections (collection_A and collection_B) that I wanna run in parallel? How would the options parameter change? Have u tried this? What that lab provides out of the box seems to be more for a load testing use case but I wanna run multiple collections in parallel; like collection_A and collection B in parallel; any idea?
I would much rather to write a bash script than that .js file
failures.failures throws undefined for me, had to access a different property as failures is an array. For me failures[0].error.message was the way to go
try node simple.js & node simple.js & node simple.js & node simple.js & node simple.js & node simple.js & node simple.js to run it multiple times
|
38

As of July 2023 Postman v10.15

Postman has added a testing API with a performance tab and can run multiple requests at the same time.

This also come with metrics as how much your API performs stated in here

this answer is based off of @walter33's answer, which includes more detail

enter image description here


As of Feb 2024 Postman v10.22 (Updated)

@Nermin, Postman has added testing API with data file on performance tab.

You can add a csv or json file and preview the data before you run the API as stated here.

Performance Tab with data file

3 Comments

I still don't understand how I am going to use this to call my API e.g. 1000 times in parallel with different payload. I would like a version of the "normal" collection runner, only parallel.
i have edited the answer, now for a limited time postman allows for calling API with different data, it can be just 1 API call per data or multiple for a period of time
this method reuses the data from csv/datafile and keep running the requests repeatedly until test duration time. I think @Nermin (and myself) is looking for a feature where run would stop if it reaches end of datafile which seems to be possible from Functional run only which don't have parallel feature.
32

Not sure if people are still looking for simple solutions to this, but you are able to run multiple instances of the "Collection Runner" in Postman. Just create a runner with some requests and click the "Run" button multiple times to bring up multiple instances.

3 Comments

This will not run request parallel as asked in question
Vaibhav; each test runner instance will run in parallel.
the Question is about request within 1 collection
13

The Runner option is now on the lower right side of the panel

enter image description here

Comments

7

Run all Collection in a folder in parallel:

'use strict'; global.Promise = require('bluebird'); const path = require('path'); const newman = Promise.promisifyAll(require('newman')); const fs = Promise.promisifyAll(require('fs')); const environment = 'postman_environment.json'; const FOLDER = path.join(__dirname, 'Collections_Folder'); let files = fs.readdirSync(FOLDER); files = files.map(file=> path.join(FOLDER, file)) console.log(files); Promise.map(files, file => { return newman.runAsync({ collection: file, // your collection environment: path.join(__dirname, environment), //your env reporters: ['cli'] }); }, { concurrency: 2 }); 

Comments

7

In postman's collection runner you can't make simultaneous asynchronous requests, so instead use Apache JMeter instead. It allows you to add multiple threads and add synchronizing timer to it

Comments

7

According to Postman's official documentation you can do that Updated august 2023 , To configure a performance test in the Postman desktop app, do the following:

  1. Select Collections in the sidebar and select the collection you want to use for performance testing.

  2. On the collection's Overview tab, select Runner icon Run.

  3. Select the Performance tab.

  4. Enter the number of Virtual users. While the test is running, each virtual user runs the selected requests in the specified order in a repeating loop. A higher number of virtual users puts increased load on your API.

  5. Enter the Test duration in minutes.

  6. Select a Load Profile.

  • Fixed - The number of virtual users you specified is used throughout the test.
  • Ramp up - Enter a Ramp up duration in minutes. During the ramp-up period, the number of virtual users gradually increases to the number of users you specified. When you're ready to begin the performance test, select Run.

enter image description here

2 Comments

But here the problem or at least I can not figure out the way to pass different data to each concurrent request. For e.g. Let's take just one Post request, we are running for 20 Users How can you specify different payload for each user?
5

If you are only doing GET requests and you need another simple solution from within your Chrome browser, just install the "Open Multiple URLs" extension:

https://chrome.google.com/webstore/detail/open-multiple-urls/oifijhaokejakekmnjmphonojcfkpbbh?hl=en

I've just ran 1500 url's at once, did lag google a bit but it works.

Comments

5

If you need to generate more consecutive requests (instead of quick clicking SEND button). You can use Runner. Please note it is not true "parallel request" generator.

File->New Runner Tab

enter image description here

Now you can "drag and drop" your requests from Collection and than keep checked only request you would like to generate by a Runner setting 10 iterations (to generate 10 requests ) and delay for example to 0 (to make it as fast as possible).

enter image description here

2 Comments

This would be one by one, not trigger them at the same time I think.
@highjump You are right, this trigger request one by one. It generates more consecutive requests. It is not true "parallel request" generator.
2

Easiest way is to get => Google Chrome "TALEND API TESTER" Go to help + type in Create Scenario ...or just go to this link => https://help.talend.com/r/en-US/Cloud/api-tester-user-guide/creating-scenario

I was able to send several POST API calls simultaneously.

Comments

2

pm.sendRequest is asynchronous, and will execute a single request in a non-blocking manner. Knowing this, it is possible to take advantage of this by stacking up asynchronous pm.sendRequest() calls in a pre-request script either on a folder or request. The caveat here is that the actual request while necessary for postman to execute anything is not relevant to the test.

I setup a quick concurrency test using two dummy requests (dummy and dummy2) like so (pre-requests and tests in my case is on the folder level. All requests are to the postman echo endpoint): ConcurrentEcho ONE Pre-request Script:

pm.sendRequest('http://postman-echo.com/get', function(err,res) { console.log('executing request 1'); pm.collectionVariables.set('res1', res); }) pm.sendRequest('http://postman-echo.com/get', function(err,res) { console.log('executing request 2'); pm.collectionVariables.set('res2', res); }) pm.sendRequest('http://postman-echo.com/get', function(err,res) { console.log('executing request 3'); pm.collectionVariables.set('res3', res); }) 

Test:

const res1 = pm.collectionVariables.get('res1'); const res2 = pm.collectionVariables.get('res2'); const res3 = pm.collectionVariables.get('res3'); pm.test('Validate responses', function () { for (const res of [res1,res2,res3]) { pm.expect(res).to.have.property('code', 200); pm.expect(res).to.have.property('status', 'OK'); } }); 

TWO Pre-request Script:

pm.sendRequest('http://postman-echo.com/get', function(err,res) { console.log('executing request 4'); pm.collectionVariables.set('res4', res); }) pm.sendRequest('http://postman-echo.com/get', function(err,res) { console.log('executing request 5'); pm.collectionVariables.set('res5', res); }) pm.sendRequest('http://postman-echo.com/get', function(err,res) { console.log('executing request 6'); pm.collectionVariables.set('res6', res); }) 

Test:

const res4 = pm.collectionVariables.get('res4'); const res5 = pm.collectionVariables.get('res5'); const res6 = pm.collectionVariables.get('res6'); pm.test('Validate responses', function () { for (const res of [res4,res5,res6]) { pm.expect(res).to.have.property('code', 200); pm.expect(res).to.have.property('status', 'OK'); } }); 

The output looks like the following:

>Get http://postman-echo.com/get "executing request 2" >Get http://postman-echo.com/get "executing request 3" >Get http://postman-echo.com/get "executing request 1" >Get http://postman-echo.com/get >Get http://postman-echo.com/get <==This is dummy request "executing request 4" >Get http://postman-echo.com/get "executing request 6" >Get http://postman-echo.com/get "executing request 5" >Get http://postman-echo.com/get <==This is dummy2 request 

collectionRunner output

Comments

1

You can use Fiddler with started traffic capture to record manual queries from Postman, then select them in Fiddler's sessions list as much as you want and replay (press R key) - they would run in parallel.

https://docs.telerik.com/fiddler/generate-traffic/tasks/resendrequest

Comments

0

You can copy the curl from postman:

enter image description here

Then write a small bash script like:

#!/bin/bash # This script sends the same cURL POST request 100 times to the specified endpoint. # Loop from 1 to 100 for i in {1..100} do # Print the current request number to the console to track progress echo "Sending request #$i..." curl 'YourAPIEndpointHere' # Uncomment the next line if you want to add a delay between requests # sleep 1 done echo "Script finished. Sent 100 requests." 

Comments

-3

You can run multiple instances of postman Runner and run the same collection with different data files in each instance.

2 Comments

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
Or you could have asked him to have 10 laptops with postman send request from each one.
-8

Open multiple postman. It replicates it and run concurrently.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.