How to generate a custom newman report for postman test

ยท

2 min read

How to generate a custom newman report for postman test

As a tester, an essential part of your process is how to generate your API test report.

In this blog post, I will be going through the basic steps of how I generate a custom newman HTML report for my API automated test on Postman.

The First step is exporting your postman collection and environment.

  1. On your postman workspace, click on the three dots beside your postman collection.
  2. Click on the export option Screenshot 2022-04-29 at 11.02.08.png
  3. Export the collection as a json file Screenshot 2022-04-29 at 11.03.58.png
  4. You'll also need to export your postman environment file just as you exported the collection json file above.
  5. Create a folder on your local computer and save the exported json files inside it.

Second step is installing newman and newman reporter

  1. Download node js on your computer here

  2. Install npm using npm i newman

  3. Install newman HTML reporter by using npm i newman-reporter-htmlextra

Verify you have installed each package successfully by running the following commands

  • Node js - node --v
  • npm - npm --version

You should get a response like this Screen Shot 2022-04-29 at 13.31.26.png

Now let us generate a custom HTML newman report for our test

Open your command line or Terminal

  1. CD into the folder you have your postman collection and env file.

  2. Run command newman run {{postmancollection.json}} -e {{postmanenvironment.json}} -r htmlextra

An example

newman run Xend.postman_collection.json -e ktest.postman_environment.json -r htmlextra
  1. Go back into your folder you will see a new folder named "newman", inside the folder is where your reports are stored. Screenshot 2022-04-29 at 15.44.02.png Here is a sample image of how the HTML report looks like Screenshot 2022-04-29 at 15.46.29.png

I have just shown you how to generate a custom template for your API test report.

Also, note that we have different HTML report templates and it depends on the format you desire.

Don't forget to like and follow my blog if you find this useful and also drop your comments ๐Ÿ™