We can run Postman Collection on Jenkins. Firstly, we have to install Newman. To trigger an execution, we shall create a Collection having a minimum one request.
The below steps list down the steps to run Postman Collection on Jenkins.
Step 1 − Click on the arrow beside the Collection name in the sidebar and then click on Share.
Step 2 − The SHARE COLLECTION1 dialogue box shall open. Click on the Get public link tab followed by copying the link which is highlighted in the below image.
Please note -This link is not universal and applied to a specific user.
Step 3 − Once Jenkins is opened, we shall navigate to the Jenkins Job below the build section and type the command given below:
newman run "<link copied in Step2>"
Step 4 − The changes shall be saved and then we shall trigger the build.
Step 5 − The Jenkins Console Output displays the logs about the test results, API information, Response status, time, payload size and so on. Besides, the Console Output will have the Unicode text.
Step 6 − To remove the Unicode text from the Jenkins Console Output, we have run the below command in the build section.
newman run "<link copied in Step2>" --disable-unicode
Step 7 − Again Save the changes and start the build. The Jenkin job should kick off.
Step 8 − Jenkins Console Output logs shall now have the status of test results, API information, Response status, time, and payload size, number of requests,iterations, assertions, count of pre-request and test scripts and so on in form of a table.