DEV Community

Preecha
Preecha

Posted on

How to Run Postman Collections in CI Without Newman

TL;DR

Newman, Postman’s official CLI runner, requires npm and Node.js in your CI pipeline. That adds dependency management overhead, increases npm supply chain exposure, and Postman collection runs via the API are rate-limited on the free tier. This guide shows three Newman alternatives for CI API testing: Apidog CLI, k6, and Hurl.

Try Apidog today

💡 Apidog is a free, all-in-one API development platform. Its CLI runner executes Postman-compatible collections in CI with no npm dependency and no run-count limits. Try Apidog free, no credit card required.

Introduction

Newman made Postman collections easy to automate in CI. You could export a collection, run it from the command line, and plug it into GitHub Actions, GitLab CI, Jenkins, or any other pipeline.

But teams using Newman now commonly run into three issues:

  1. npm dependency in CI

    Newman is installed from npm. That means your API test job depends on the npm registry and the Node.js package ecosystem. Incidents like the ua-parser-js compromise in 2021 and the node-ipc incident in 2022 showed that npm supply chain attacks are a real CI risk.

  2. Postman run limits

    Postman collection runs through the Postman API are limited on free and basic paid tiers. If your pipeline runs frequently, those limits can force plan changes or pipeline redesigns.

  3. Slower Newman maintenance

    Newman is not officially deprecated, but its maintenance pace has slowed. Some GitHub issues stay open for months, and newer Postman scripting APIs may have inconsistent support.

If you want to keep API tests in CI without relying on Newman, these are the practical options.

Option 1: Apidog CLI

Apidog CLI is the closest Newman replacement if you already have Postman collections.

It supports:

  • Postman Collection v2 and v2.1 format
  • Postman environment JSON exports
  • pm.test
  • pm.expect
  • pm.environment.set
  • pm.collectionVariables.set
  • Pre-request scripts
  • Post-request scripts
  • CSV and JSON data-driven testing
  • JUnit XML and JSON output for CI reporting

Why use it:

  • No npm required: Apidog CLI is distributed as a standalone binary.
  • No per-run limits: Apidog does not cap collection runs on any plan.
  • Postman-compatible workflow: Export your collection and environment, then run them directly in CI.

Install Apidog CLI

Download the CLI binary from apidog.com/cli, or use the shell installer:

# macOS / Linux
curl -sSf "https://apidog.com/cli/install.sh?utm_source=dev.to&utm_medium=wanda&utm_content=blog-sync" | sh

# Verify installation
apidog --version
Enter fullscreen mode Exit fullscreen mode

For Docker-based CI runners, use the official image:

FROM apidog/cli:latest
Enter fullscreen mode Exit fullscreen mode

Run a Postman collection

Export your collection from Postman:

File > Export > Collection v2.1
Enter fullscreen mode Exit fullscreen mode

Export your environment:

Manage Environments > Export
Enter fullscreen mode Exit fullscreen mode

Then run:

apidog run collection.json \
  --environment environment.json \
  --reporter-junit results.xml
Enter fullscreen mode Exit fullscreen mode

GitHub Actions example

name: API Tests

on: [push, pull_request]

jobs:
  api-tests:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Install Apidog CLI
        run: curl -sSf "https://apidog.com/cli/install.sh?utm_source=dev.to&utm_medium=wanda&utm_content=blog-sync" | sh

      - name: Run API tests
        run: |
          apidog run ./tests/collection.json \
            --environment ./tests/env.json \
            --reporter-junit test-results.xml

      - name: Upload test results
        uses: actions/upload-artifact@v4
        if: always()
        with:
          name: api-test-results
          path: test-results.xml
Enter fullscreen mode Exit fullscreen mode

This removes the need for:

  • npm install
  • package.json
  • Node.js setup
  • Node.js version matrix maintenance

GitLab CI example

api-tests:
  image: apidog/cli:latest
  script:
    - |
      apidog run ./tests/collection.json \
        --environment ./tests/env.json \
        --reporter-junit test-results.xml
  artifacts:
    reports:
      junit: test-results.xml
Enter fullscreen mode Exit fullscreen mode

Option 2: k6

k6 is a load testing tool from Grafana Labs that can also run functional API checks. It is useful when you want correctness checks and performance thresholds in the same pipeline.

It supports:

  • HTTP/1.1
  • HTTP/2
  • WebSocket
  • gRPC
  • JavaScript test scripts
  • Performance thresholds
  • Output to InfluxDB, Prometheus, and Datadog

It does not natively support:

  • Postman collection format
  • Postman’s pm.* API

You can convert Postman collections with postman-to-k6, but generated scripts often need manual cleanup, especially if your Postman collection uses complex scripts.

When to choose k6

Choose k6 if your API test pipeline needs performance testing, for example:

  • Validate response correctness under load
  • Fail builds when latency exceeds a threshold
  • Test REST and gRPC endpoints in the same suite

If you only need a direct Newman replacement for Postman collections, Apidog CLI is usually faster to adopt.

Basic k6 usage

# Install on Linux
sudo apt-get install k6

# Run a test script
k6 run api-tests.js
Enter fullscreen mode Exit fullscreen mode

Example k6 script:

import http from 'k6/http';
import { check } from 'k6';

export const options = {
  thresholds: {
    http_req_duration: ['p(95)<500'],
  },
};

export default function () {
  const res = http.get('https://api.example.com/users/1');

  check(res, {
    'status is 200': (r) => r.status === 200,
    'has id': (r) => JSON.parse(r.body).id === 1,
  });
}
Enter fullscreen mode Exit fullscreen mode

k6 exits with pass/fail status based on checks and thresholds. JUnit XML output is available through the k6-reporter package.

Option 3: Hurl

Hurl is an open-source HTTP testing tool written in Rust. It uses a plain-text DSL for requests and assertions.

It supports:

  • HTTP/1.1
  • HTTP/2
  • JSON assertions
  • XPath assertions
  • Regex assertions
  • Variables
  • Request chaining
  • HTML, JUnit, and JSON output

It does not support:

  • Postman collection format
  • JavaScript test scripts

Hurl tests are declarative. Instead of writing JavaScript assertions, you write .hurl files.

When to choose Hurl

Choose Hurl if:

  • You are starting a new API test suite
  • You do not need Postman compatibility
  • You want a small standalone binary
  • You prefer readable text-based test files

Hurl is less convenient if you already have a large Postman collection, because there is no automated Postman-to-Hurl converter.

Basic Hurl test

GET https://api.example.com/users/1
HTTP 200
[Asserts]
jsonpath "$.id" == 1
jsonpath "$.email" isString
Enter fullscreen mode Exit fullscreen mode

Hurl in GitHub Actions

- name: Install Hurl
  run: |
    curl -LO https://github.com/Orange-OpenSource/hurl/releases/latest/download/hurl-x86_64-unknown-linux-gnu.tar.gz
    tar -xf hurl-*.tar.gz
    sudo mv hurl /usr/local/bin/

- name: Run API tests
  run: hurl --test tests/*.hurl
Enter fullscreen mode Exit fullscreen mode

Comparison

Feature Apidog CLI k6 Hurl
Postman import Native Converter, with possible manual cleanup No
npm dependency No No No
JavaScript scripting Yes, pm.* API Yes, ES6 No, DSL only
Performance testing No Yes No
Binary size ~50 MB ~30 MB ~10 MB
Free run limits None None None
JUnit output Yes Via plugin Yes

Migrating from Newman to Apidog CLI

If your CI pipeline currently uses Newman, use this migration path.

1. Export your Postman collection

In Postman, export each collection as Collection v2.1:

Collection > Export > Collection v2.1
Enter fullscreen mode Exit fullscreen mode

Export environments separately:

Manage Environments > Export
Enter fullscreen mode Exit fullscreen mode

Commit the exported files into your test directory, for example:

tests/
  collection.json
  env.json
Enter fullscreen mode Exit fullscreen mode

2. Install Apidog CLI in CI

For GitHub Actions:

- name: Install Apidog CLI
  run: curl -sSf "https://apidog.com/cli/install.sh?utm_source=dev.to&utm_medium=wanda&utm_content=blog-sync" | sh
Enter fullscreen mode Exit fullscreen mode

Or use Docker:

api-tests:
  image: apidog/cli:latest
Enter fullscreen mode Exit fullscreen mode

3. Replace the Newman command

A typical Newman command:

newman run collection.json \
  -e environment.json \
  --reporters junit \
  --reporter-junit-export results.xml
Enter fullscreen mode Exit fullscreen mode

Equivalent Apidog CLI command:

apidog run collection.json \
  --environment environment.json \
  --reporter-junit results.xml
Enter fullscreen mode Exit fullscreen mode

4. Validate script compatibility locally

Run the collection locally before changing your CI pipeline:

apidog run ./tests/collection.json \
  --environment ./tests/env.json \
  --reporter-junit test-results.xml
Enter fullscreen mode Exit fullscreen mode

Most pm.* scripts run without modification. Scripts that use pm.require to load external modules may need adjustment.

5. Remove Node.js if it is no longer needed

If Newman was the only reason your pipeline installed Node.js, remove:

  • Node.js setup steps
  • npm install
  • Newman dependency installation
  • Newman-specific cache configuration

That reduces your dependency surface and simplifies the job.

FAQ

Is Newman officially deprecated?

No. As of early 2026, Newman is still maintained by Postman. However, its maintenance pace has slowed, and some open issues affect real-world use cases.

Does Apidog CLI require an Apidog account?

For running locally exported collections, no. For syncing collections from an Apidog workspace, yes. If you are migrating from Postman, you can run from exported JSON files.

Can Apidog CLI run data-driven tests?

Yes. Pass a CSV or JSON data file with the --iteration-data flag. This is equivalent to Newman’s -d flag.

apidog run collection.json \
  --environment environment.json \
  --iteration-data data.csv
Enter fullscreen mode Exit fullscreen mode

What is the supply chain risk with npm-based runners?

Any package installed from npm during CI can become an attack surface. A compromised package can attempt to read environment variables, including API keys and CI tokens. Using a standalone binary downloaded over HTTPS and pinned by checksum avoids this class of npm-specific risk.

Does k6 support gRPC testing?

Yes. k6 has native gRPC support, so it can test REST and gRPC APIs in the same suite.

Does Hurl support authentication headers?

Yes. Hurl supports custom headers, including Authorization, bearer tokens, and cookie-based authentication.

Example:

GET https://api.example.com/me
Authorization: Bearer {{token}}
HTTP 200
Enter fullscreen mode Exit fullscreen mode

Conclusion

Newman is no longer the only practical way to run API tests in CI. If you already have Postman collections, Apidog CLI gives you the most direct migration path: export the collection, run it with a standalone binary, and keep JUnit reporting in your pipeline.

Use k6 when performance testing is part of the requirement. Use Hurl when you want a small, dependency-free DSL for new API test suites.

Top comments (0)