Integrating Postman with Jenkins

Understanding the Integration
Integrating Postman with Jenkins can significantly enhance your API testing and automation workflows. By integrating these tools, you can
Automate API Testing: Execute Postman collections as part of your Jenkins pipeline.
Trigger Jenkins Jobs: Use Postman to trigger Jenkins jobs based on specific API responses or events.
Share and Collaborate: Easily share and collaborate on API tests within your team.
Continuous Integration and Delivery: Incorporate API testing into your CI/CD pipeline.
Run a Manage Environment in Postman
1.Click the Environment quick look (eye button) in the top right of Postman and click Edit next to Global.
2.Add a variable named my_variable and give it an initial value of Hello—click Save and close the environment modal.
3.Open a new request tab and enter https://postmanecho.com/get?var={{my_variable}} as the URL. However over the variable name and you'll see the value.
4.Send the request. In the response, you'll see that Postman sent the variable value to the API. Try changing the value in the Environment quick look and sending the request again.
Install Newman on Command Line
Install NodeJS and npm. Newman is written in NodeJS and the official copy is available through npm. Install nodejs and npm for windows. Install Newman globally, to set up Newman as a command line tool in Window. Run an API through a command line.
Run a collection using Newman
Run this collection inside Newman, using the command below. If everything is set up nicely, you should see the output below.
Install and Create project in Jenkins
Install jenkins on your local system and access it by using http://localhost:8080.
Create a new job by clicking on the “New Item” link on the left sidebar > Select a “Freestyle Project” from the options > Name your project.
Add a build step in the project. And select the Executes windows batch command.
Insert below command in cmd
newman run C:\Users\Ankita.lunawat\Downloads\demo.json --disable-Unicode.
the Newman command parameter ”suppress-exit-code” uses the value. Above command excutes the project demo.json. Newman provides the flag –disableunicode to remove the Unicode text from the logs. Click the Save button to finish creating the project.
Save the changes and click on Build Now. Now, the console gives a expected visually structured output. Run this build test manually by clicking on the “Build Now” link in the sidebar. You can check the “Console Output” by clicking on link in the sidebar to see what Newman returned.
By integrating Postman with Jenkins, you can significantly enhance your API testing and automation workflows, ensuring the quality and reliability of your APIs.
Subscribe to my newsletter
Read articles from Ankita Lunawat directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Ankita Lunawat
Ankita Lunawat
Hi there! I'm a passionate AWS DevOps Engineer with 2+ years of experience in building and managing scalable, reliable, and secure cloud infrastructure. I'm excited to share my knowledge and insights through this blog. Here, you'll find articles on: AWS Services: Deep dives into core AWS services like EC2, S3, Lambda, and more. DevOps Practices: Best practices for CI/CD, infrastructure as code, and automation. Security: Tips and tricks for securing your AWS environments. Serverless Computing: Building and deploying serverless applications. Troubleshooting: Common issues and solutions in AWS. I'm always eager to learn and grow, and I hope this blog can be a valuable resource for fellow DevOps enthusiasts. Feel free to connect with me on [LinkedIn/Twitter] or leave a comment below!