How to Run Collections from Jenkins
In the previous articles on Postman Tutorial, we have covered “How to run Collections Remotely (with URL) in Postman“
In this “How To Run Collections from Jenkins” article, I will be demonstrating how you can implement this concept and get a tight grip over this.
Follow the steps to create a new job in Jenkins and run Postman Collections from Jenkins.
1. Create a new job. Click on New Item.
2. Enter any name and select Freestyle project and Hit Ok.
3. Now we have to configure this. Under the Build Environment tab, we will go to the Build section and add a build step. For windows machine, select Execute Windows batch command. For Mac or Linux, select Execute shell
4. Now we have to give the command to run the postman collection.
C:\Users\Test\AppData\Roaming\npm\newman run https://www.getpostman.com/collections/8daaf8118386c8fce5ef
Click on Save.
5. Go to the Home page and click on the Manage Jenkins option on the extreme left side. Then Click on Configure Systems. Now under Global Properties section, click on environmental variables and add Name: PATH, Value: C:\Program Files\Nodejs
6. Under the Shell section, Add C:\Windows\System32\cmd.exe in Shell executable field. Click Save.
7. Now run the job using option Build Now. A new build will be started.
8. We can see the Console Output as well. We get Unicode character, so we can view it as plain text. We can now see our Postman run getting executed and we are getting the report as well on Jenkins.
Next steps:
Learn “How to debug Collection run in Postman” in the next tutorial.
Related posts: