Beta feature

Run a performance test using the Postman CLI

With performance tests, you can simulate user traffic and observe how your API behaves under load, identifying potential issues that affect performance. You can use the Postman CLI to trigger performance tests for specified collections, all within your CI/CD pipeline. Your team can use your tests to automatically catch performance issues during the deployment process. Depending on whether the performance test passes or fails, you can push or roll back your changes.

With the postman performance run command, you can configure a performance test for a collection. Add the command into your CI/CD script to integrate performance tests into your workflow. Postman recommends replacing your collection ID and API key with variables.

The Postman CLI triggers the performance test using the postman performance run command. The performance test runs against the specified collection according to your performance test configuration. Then the Postman CLI makes the test results available in the performance test results in Postman.

Run a performance test within your CI/CD pipeline

Use the following Postman CLI commands to configure your CI/CD script to run performance tests.

  1. Use the command to install the Postman CLI. You can use the following command to install the Postman CLI using npm:

    npm install -g postman-cli
    
  2. Use the command to sign in to Postman with the --with-api-key option to authenticate using your Postman API key. You can use the following command to sign in and authenticate using your Postman API key:

    postman login --with-api-key <postman-api-key>
    
  3. Use the command to run a performance test for a specific collection using its ID. Configure the performance test using its supported options to specify the number of virtual users to simulate, pass or fail conditions, and more. You can use the following command to run a performance test using the default settings:

    postman performance run <collection-id>
    
  4. Paste the Postman CLI installation, login, and performance commands into your CI/CD script. This process depends on your CI tool.

The following example shows how to add the Postman CLI commands to GitHub Actions:

name: Run performance tests using the Postman CLI

on: push

jobs:
  automated-api-tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Postman CLI
        run: npm install -g postman-cli

      - name: Login to Postman CLI
        run: postman login --with-api-key ${{ secrets.POSTMAN_API_KEY }}

      - name: Run performance test
        run: postman performance run ${{ vars.COLLECTION_ID }}

Last modified: 2025/12/19