newman
Run Postman collections from the command line
TLDR
SYNOPSIS
newman run collection [options]
DESCRIPTION
newman is the command-line companion for Postman that runs exported collections, enabling automated API testing. It executes all requests in a collection sequentially, running pre-request scripts and tests, and reports results.Newman integrates with CI/CD pipelines to automate API testing. It supports data-driven testing through CSV/JSON files, multiple reporters for output formatting, and environment/global variable management.
PARAMETERS
COLLECTION
Postman collection file path or URL.-e FILE
Specify an environment file.-g FILE
Specify a globals file.--folder NAME
Run only a specific folder from the collection.-r REPORTERS
Comma-separated reporter types (cli, json, junit, html).-n COUNT
Number of iterations to run.-d FILE
Data file (CSV or JSON) for iteration variables.--global-var KEY=VALUE
Set a global variable via the command line (repeatable).--env-var KEY=VALUE
Set an environment variable via the command line (repeatable).--bail
Stop the run on the first test failure.--timeout MS
Time in milliseconds to wait for the entire collection run to complete.--timeout-request MS
Time in milliseconds to wait for each request.-x, --suppress-exit-code
Override the default exit code for the run.--color VALUE
Control color output: on, off, or auto (default).--help
Display help information.
CAVEATS
Requires Node.js. Collections must be exported from Postman in JSON format. The HTML reporter requires an additional npm package (newman-reporter-html). Collection v1 format is deprecated; use v2 or later.
HISTORY
Newman was created by Postman to enable command-line execution of API collections for testing automation.
