57

I have added the plugin Postman to Chrome browser for load testing of my API.

But I am clueless about how to do the load test with Postman tool.

My query is how to simulate "Virtual Users" in this tool?

Bilesh Ganguly
  • 3,792
  • 3
  • 36
  • 58
Kuntal
  • 611
  • 1
  • 6
  • 6

10 Answers10

41

Postman has a Collection Runner which can be used for making API calls with multiple iterations.
You might be able to use it for load testing if you can figure out how to get it to run requests in parallel.

enter image description here

Matt Frear
  • 52,283
  • 12
  • 78
  • 86
  • 2
    Collection Runner is used for running multiple request simultaneously, but it can not run requests in parallel. – Vikash kumar Yadav Mar 02 '22 at 08:14
  • There is no workaround needed anymore. The performance test feature is available in the Canary build of Postman. Check out my answer for details. – elyptikus Jun 20 '23 at 07:28
30

It exists a converter to generate a k6 load test from a Postman collection.

https://github.com/apideck-libraries/postman-to-k6

npm install -g @apideck/postman-to-k6
postman-to-k6 collection.json -o k6-script.js
k6 run --vus 100 --duration 3m k6-script.js

For further information, check out the following article Load Testing Your API with Postman

ppcano
  • 2,831
  • 1
  • 24
  • 19
  • I converted a very simple postman request with a single pm.test() assert to k6 script. I cannot ever get it to pass. It passes fine in postman but not after I convert it and run with k6. I posted issue in k6 issue forum: https://github.com/k6io/postman-to-k6/issues/107 – Andy N Jun 08 '21 at 16:14
  • k6 converted postman tests seem to be having one-issue-after-another to resolve. At this point, postman-to-k6 conversion is not really a viable option. – vkhazin Oct 21 '21 at 12:53
28

Hi I would suggest That you use Jmeter for load testing it is designed for it. But some people find it easier to use postman as collections are already created in it and it is much more interface friendly.

Step 1- Click on the little arrow along with your collection in the collection listing Little arrow along with collection

Step 2- Then click on the Run button to launch Collection runner Collection runner

Collection runner is the part which is used for sort of Load testing

Step 3- Collection runner has a lot of important parts to consider for load testing Collection runner 2

The screenshot has counts that explains each part

  1. Is the iterations or the number of users

  2. Is the ramp up time or how often the users will hit or come

  3. Is for logging requests

  4. Date selection for what day this test was done

  5. For running the test

  6. All Api collection

  7. All Api listing

  8. Environment selection

After running the required results will show and I have redacted information for privacy

Moeez Mazhar
  • 632
  • 7
  • 11
  • 2
    thanks for caring to give the detailed explanations. – Valentine Shi Feb 14 '20 at 05:55
  • 2
    "iterations" sounds like how many times to repeat the test? – cs94njw Jul 30 '20 at 15:22
  • 1
    ``` The number of iterations for your collection run. You can also run collections multiple times against different data sets to build workflows. An interval delay (milliseconds) between each request. ``` https://learning.postman.com/docs/running-collections/intro-to-collection-runs/#starting-a-collection-run – cs94njw Jul 30 '20 at 15:23
23

I don't think you'll be able to conduct load testing using Chrome Extension, consider more specialised tools for it, i.e. SoapUI or Apache JMeter

References:

SoapUI is designed for testing web services and load testing is secondary option and JMeter is designed for load testing and doesn't have any web-services specific functionality however if I had to choose I would go for JMeter as it can produce more immense load and has better reporting capabilities.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
18

You can open multiple Collection Runner windows in Postman to run parallel collections.

Click on the Run again and again. You will get new collection window opened. Kick off each collection one by one and they all will start running.

Example

John Humphreys
  • 37,047
  • 37
  • 155
  • 255
Ramesh
  • 681
  • 7
  • 15
  • Can you explain a bit more? How do you open the those windows? Please elaborate by editing your answer. – JJJ Mar 20 '19 at 13:23
  • 2
    click on the Run again and again. You will get new collection window opened. Kick off each collection one by one and they all will start running. https://i.stack.imgur.com/K1qSf.png – Ramesh Mar 20 '19 at 15:26
2

In short, there is no way to perform load test through Postman directly. You can use different tools like Jmeter and SOAP UI etc.

2

You can't perform load testing with Postman, but you can adapt your test suites implemented in postman collections to load testing tools using the newman utility (which is especially useful in conjunction with the jq program).

Vladimir Shiyanov
  • 1,236
  • 16
  • 18
0

The Taurus open source project provided by BlazeMeter might become an option in the future. They do not support multiple instances yet. https://gettaurus.org/docs/Postman/

If you can measure your API performance from the server side and you have a big machine. The Postman Runner in the Postman client can be started multiple times. Set the iteration to a very large number and click start. Then go back to the collection page and open a new Runner page by clicking RUN again. Repeat until your reach your target volume.

Alternatively, you can run the Newman command multiple times using Powershell for example.

# Start 5 newman run of 10 iterations    
for($i = 0; $i -lt 5; $i++)
{
  Start-Job -Scriptblock {
    newman run "./postman_collection.json" --environment "environment.json" --iteration-count 10 --disable-unicode --silent --suppress-exit-code
  }
}

# Wait for all to complete
While (Get-Job -State "Running") { Start-Sleep 2 }

# Display output from all jobs
Get-Job | Receive-Job

# Cleanup
Remove-Job *
Yann
  • 1
  • 4
0

Great news! There is a way now.

As of today, this feature is only available in the Canary Build but should be available in the productive version soon as well. Edit: The funciton is now available in the normal version of Postman as well.

To do so:

  1. Select a Postman Collection or select an environment and click on Run:
  2. Select the Performance tab under Runner and specify the load settings such as "virtual users", then click Start.
  3. Observe the response times and throughput (requests per second) in real-time.
  4. Once the run is completed, observe and identify bottlenecks in response times and requests per second result of postman performance test
elyptikus
  • 936
  • 8
  • 24
0

We can use Postman Collection Runner for load test. Please find below step by step process.

Step1:- Select a Postman Collection or select an environment and click on Run

enter image description here

Step2:- Select the Performance tab under Runner and specify the load settings, click Start

enter image description here

Step3:- Observe the response times and throughput (requests per second) in real time

enter image description here

Step4:- Once the run is completed, observe and identify bottlenecks in response times and requests per second

enter image description here

vinod_vh
  • 1,021
  • 11
  • 16