Google News
logo
Postman - Interview Questions
How can Postman collections run through the command line?
Postman has a command-line integration tool called Newman with which you can run any existing Postman collection.
 
Newman is a nodejs based package, which requires just a node environment to execute the collection and has full parity with the Postman collection runner i.e. the Newman collection runner supports the Postman capabilities like Running assertions, Pre-request scripts or any other scripts that are associated with the requests that are a part of the collection.
 
To use Newman :
 
* You need to have node installed.
* Now the Newman package needs to be installed through npm using the command.
npm install -g newman
* The collection needs to be executed and the associated environment configuration should be first exported to its JSON form through the Postman application
* Now run the below command to run the Postman collection through Newman.
newman run {{path to collection json}} -e {{path to environment json if any}}
Advertisement