How to generate Newman Report in Jenkins

Last Updated On

HOME

Postman contains a full-featured testing sandbox that enables you to write and execute JavaScript-based tests for your API. You can then integrate Postman with your CI/CD build system using Newman, the command-line collection runner for Postman. In this tutorial, we are going to learn how we can create a Newman Report in Jenkins.

Table of Contents

Prerequisite:

  • Jenkins installed on the machine
  • NodeJS installed on the machine

Implementation Steps

Step 1: Download the NodeJS Plugin

To generate a Performance Report in Jenkins, we need to download NodeJS Plugin. Please refer to this tutorial to install the plugin – How to install Plugins in Jenkins.

Go to Manage Jenkins > Manage Plugins and install the NodeJS plugin.

Step 3: Create a new FreeStyle project

  1. Give the Name of the projectPostman_Demo
  2. Click on the FreeStyle project. 
  3. Click on the OK button.

In the General section, enter the project description in the Description box.

Step 4: Source Code Management

Select Source Code Management as None if the project is locally present on the machine.

Step 6: Select Execute Windows batch command

In the Build Steps section, select Execute Windows batch command.

Use the below command to go to the path where the JMeter is placed in your system.

cd C:\Users\Vibha\Desktop\Postman
newman run --disable-unicode API_Newman_PassedTests.json --reporters htmlextra --reporter-htmlextra-export ./results/report.html

Step 7: Select “Publish HTML reports” from “Post Build Actions”

We have created a new project Postman_Demo” with the configuration to run the Postman scripts.

Step 8: Execute the tests

Let’s execute it now by clicking on the “Build Now” button. 

Right-click on Build Number (here in my case it is #1).

Click on Console Output to see the result.

Below is the HTML Report generated in Jenkins.

	
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP","")

Congratulations on making it through this tutorial and hope you found it useful! Happy Learning!! Cheers!!

Additional Tutorials

What is Collection in Postman?
Data Driven Testing in Postman
 How to import Collection into Postman?
 How to run Postman requests from the command line
 How to generate Newman HTML Report?

Leave a comment