In the previous articles on Postman Tutorial, we have covered “How to Generate Newman Reports on Jenkins in Postman“
In this “How To Generate Advanced HTML Reports, While Using Newman” article, I will be demonstrating how you can implement this concept and get a tight grip over this.
How To Generate Advanced HTML Reports, While Using Newman
HTML reports are usually very useful. We get an overview of what happened if at any time our tests failed. We can keep a check on the tests that run every night or multiple times a day. HTML reports help in debugging.
We will use htmlextra reporter for Newman and this is an npm dependency that we need to install separately. This reporter helps to provide a very decent report with a lot of detailed information.
1. To install the htmlextra reporter, run command:
npm install -g newman-reporter-htmlextra
2. We get htmlextra reports with command:
newman run <url> –reporters=cli,htmlextra
3. The report will be saved inside the folder where Newman was executed, inside a folder called Newman.
4. In the summary page, we get an overview of what happened with the collection. We get information like how many iterations, assertions, skipped tests, failed tests. For details, we need to go to the Failed tests tab to check what exactly failed.
From the Total Requests tab, we can get lots of information like what headers did we send, where did the request goes, how did our request body look like, what headers did we get back or how did the response body look like.
We don’t get this information with the normal HTML reporter in Newman.
Learn “How to fix common errors in Postman” in the next tutorial.