Newman is the official command-line collection runner for Postman. It allows developers and QA engineers to execute API test suites directly from the command prompt or terminal.
How do I install and run Postman collections with Newman CLI?
To run a Postman collection using Newman, follow these steps:
1. Installation
Ensure Node.js is installed, then install Newman globally via npm:
npm install -g newman2. Running a Collection
Execute your exported collection JSON file along with an environment file:
newman run my_collection.json -e my_environment.json3. Generating HTML Reports
Install the HTML reporter and generate test execution reports:
npm install -g newman-reporter-htmlextra
newman run my_collection.json -r htmlextraUsing Newman in CLI enables seamless integration into CI/CD build scripts such as Jenkins, GitHub Actions, or GitLab CI.