How to Run Postman Collection on Jenkins using Newman Commands?

We can run Postman Collection on Jenkins using Newman commands. To achieve this, we should first have a Collection with a minimum one request and a test. Also, we should have Newman installed in our system.

Step 1 − Click on the arrow to the right of the Collection name. Then click on the Share button.

Step 2 − The SHARE COLLECTION1 window opens up. Go to the Get public link tab.Then copy the link which is highlighted in the below image.

Please note − This link is unique to a user.

Step 3 − Open Jenkins and navigate to the Jenkins Job below the build section. Add the command −

newman run "<link copied in Step2> "

Step 4 − Click on Save and then trigger the build. The Jenkin job gets triggered and the tasks declared within the job will execute.

Step 5 − Verify the Jenkins Console Output. It shall contain the test logs, API information, Response status, time, payload size and so on. Besides, the Console Output will have the Unicode text.