You can use Newman and the Postman API to run Postman Collections in your continuous integration (CI) environment. First install Node.js and Newman in your CI environment. You can then use Newman to get and run your collection using the Postman API.
Before you begin, check the following prerequisites for running collections using Newman and the Postman API:
Developing an API? Postman offers built-in tools to integrate your API with some of the most popular continuous integration (CI) tools. After you set up CI for your API, you can view the status of builds or start a new build, all from within Postman. You can also use Newman to run API tests as part of your CI pipeline. To learn more, see CI integrations.
To learn how to install Newman and Node.js, see Install and run Newman.
You don't need to install Node.js if your CI environment already has it installed.
To run a collection using Newman and Postman API, use the following command:
newman run "https://api.getpostman.com/collections/collection-id?apikey=postman-api-key"
If you need to provide an environment to the collection, add the --environment
option with the appropriate parameters to the Newman command:
newman run "https://api.getpostman.com/collections/collection-id?apikey=postman-api-key"
--environment "https://api.getpostman.com/environments/environment-id?apikey=postman-api-key"
Learn more about using Newman with the Postman API.
Last modified: 2024/09/16