DEV Community

Samsul Islam
Samsul Islam

Posted on

Integrating Newman with Jenkins

I assumed that you all are familiar with postman and Jenkins.

Newman is a command-line tool used to run collection of postman outside of postman.

It enables to run and test a postman collection directly from the command line interface. It helps us to integrate with continuous integration (CI) servers and generate a nice looking report.

Let's follow the steps to generate postman collection report using Jenkins:

Getting started

To get started, First we have to install Node.js to run Newman on Jenkins.

Install Node.js on Jenkins:

Here I will show you how to install nodejs in Jenkins.

Before beginning here are prerequisites.

Jenkins installed first.

You have to installed Jenkins and login before preceding.

Steps to follow

After login in jenkins click on new item or create a new Job.

Enter an item name Newman Report Gerantion and select

Freestyle project

Image description

Enter an item name in the input box ,select Freestyle project and then click on ok button. Here Freestyle project, You can run any type of build.

Now we are going to Install nodejs to running Newman,

From the dashboard or follow the link http://localhost:8080/
`

  1. Click on the project name or click on http://localhost:8080/job/newman-project/configure

2.In Build Environment check on the Provide Node & npm bin/ folder to PATH `

Image description

  1. After that in build steps(next step) click on

Execute Windows batch command,

Image description

After clicking on Execute Windows batch command in the command box just put your command like

Image description

newman run https://api.postman.com/collections/5543304-dfc8ba22-22b5-47a0-91d4-2c5d141167c0?access_key=PMAT-01GQRWA7GKRZ99KD5Y3TGZ7WMJ

To get the postman api link please collect it from postman collection, see the image below

Image description

In the final step just click apply and save button.

Now it's time to checking our newman project, it's work or not

From dashboard, click on the

project name > click on Build Now
.

From the build number go to the console output , You will see the result

Image description

Result(partial)

Image description

Thanks for your interest.

Top comments (0)