Newman is a powerful command-line tool that allows you to run and test Postman collections directly from the terminal. It is commonly used in CI/CD pipelines for automated API testing.
Newman works by executing exported Postman collections using Node.js. You interact with it entirely through the command line.
// Install Newman globally using npm
npm install -g newman
// Run a Postman collection file
newman run MyCollection.json
// Run collection with environment variables
newman run MyCollection.json -e MyEnvironment.json
Newman displays detailed results including request status, response time, assertions passed/failed, and summary statistics directly in the terminal.
The following flow shows how Newman fits into API testing: