To run the postman collections in Jenkins , follow the below steps.

  1. Download the Node js (64-bit) using below link and install the Node js application

https://nodejs.org/en/download/current/

  1. To check whether it is installed correctly, open the node js application and press “ctrl + c” twice and verify application is getting closed.

3.Add the Node executable to your system path. Go to the Control Panel > System and Security > System > Advanced System Settings > Environment variables. Append this to the end of the PATH variable: ; C:\Program Files\nodejs.

If it is installed in a different location, need to set the PATH accordingly.

  1. After successfully installed Node js, need to install Newman using command prompt. Open cmd and check the node version before installing newman.

5.Use below command in command prompt to install Newman.

“npm install -g newman”

  1. Navigate to Postman application and export and save the collections in json format.

  1. Open jenkins and create new item and freestyle project

 

  1. Navigate to project and configure the newman run to run the postman collections in jenkins.

  1. Navigate to build tab and add build step as “Execute shell ” and use below command to run the postman collection.

“newman run <YourCollectionFile.json>”

  1. Navigate to Manage jenkins > Configure system to set Environment variables path for Node js and Shell executable path to run shell command.

 

  1. After all the above configurations are set, navigate back to project and schedule the build to run the postman collections.

12.Now the scheduled build ran successfully and navigate inside the project to view the console output.