229

I want to POST data from 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?

n-verbitsky
  • 450
  • 2
  • 7
  • 18
user3384231
  • 2,541
  • 2
  • 14
  • 20

7 Answers7

227

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.

Hope that helps. But do consider jMeter (you'll love it).

Olha Horak
  • 2,860
  • 2
  • 13
  • 15
  • 7
    The site in Ray's comment has since migrated to Wordpress.com, [here is a working link](https://timbeynart.wordpress.com/2017/03/14/use-postman-to-hammer-a-rest-api/) – Aaroninus Jul 19 '19 at 18:30
138

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/

Daniel
  • 2,527
  • 1
  • 16
  • 18
49

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

Evaldas Buinauskas
  • 12,532
  • 10
  • 45
  • 88
  • 11
    Is there a way to achieve concurrent request testing with the postman ui too without using the command-line tool newman? – phil Feb 24 '17 at 11:00
  • 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? – pelican Jul 09 '18 at 18:24
  • 6
    I would much rather to write a bash script than that .js file – ttfreeman Sep 11 '19 at 19:26
18

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.

Dan
  • 670
  • 5
  • 19
6

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

RJFalconer
  • 8,488
  • 3
  • 44
  • 58
ashwath hegde
  • 410
  • 6
  • 8
5

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
});
RJFalconer
  • 8,488
  • 3
  • 44
  • 58
Michael
  • 131
  • 1
  • 11
3

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.

CularBytes
  • 8,367
  • 6
  • 65
  • 94