Open In App

How to Generate HTML Report for Postman Collection using Newman?

Last Updated : 24 May, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Newman is a command-line Collection Runner for Postman. It enables you to run and test a Postman Collection directly from the command line. It’s built with extensibility in mind so that you can integrate it with your continuous integration servers and build systems. Newman maintains feature parity with Postman and allows you to run collections the way they’re executed inside the collection runner in Postman. 

Postman is one of the most widely used applications for API testing, which provides testing for various types of HTTP requests like GET, POST, PUT and DELETE. Also, the postman provides automation testing by performing tests in several iterations using Newman or collection runner. In this article, we are going to discuss how to generate the HTML report for a postman collection using the Newman dependency.

Pre-requisites

To work with Newman we need the following dependencies already installed in our system.

1. Node.js 

Download and Install the Node.js from here

2. Newman

Install the Newman from Command Line using the command “npm install -g newman”

 

3. Newman reporter

Install the newman HTML reporter using the command “npm i-g newman-reporter-html”

 

Run using the Command Line

To run the collection, export the postman collection. After exporting, now go to the file location and open the command line in that location. Enter the command “newman run <file_name> -r html” 

 

Now a new file named “newman” is created in the folder.

 

In the Newman folder, we have the HTML report.

 


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads