HTML Reports from Postman client?

Hi Here,

Is it possible to either convert a JSON report from Postman to HTML or Ideally generate an HTML report straight from Postman?

I know you can do it with Newman, and I have done it many times. But it would make life easier if it could be done from inside the Postman client.

I’m in the process of moving the team over to postman and want it to be a smooth as possible, with as little friction as possible :slight_smile:

Thanks in advance.

1 Like

Hi @cruxto ,

When we run postman collection inside postman client, it gives automatically report in UI. For example:

This can be used to analyze the test cases.

Hope this helps :slight_smile:

Cheers pranavdavar,
It’s a good starting point, But we want to use it as test evidence for the features we are testing.
Some of our collections are quite large which is difficult to capture as evidence without exporting the collection and running in Newman.

Hi @cruxto,

Your use case gave me a great idea.

You can use export option to save the results of the collection runner in JSON format.

Now to visualize, you may use postman echo api and postman visualizer to render json data to html page.

I have created one visualizer in my postman collection. Do try it
Run in Postman

Please let me know your feed back. Below is the direct link to the request.
https://www.postman.com/deciphermiddleware/workspace/deciphermiddleware/request/1913239-6cfca667-595e-428d-b938-97a4853d7579

the output of visualizer will look like:

Hi @pranavdavar,

This is really cool, I wouldn’t have thought of doing it this way.

Do you know a way of exporting the HTML from the visualiser?

Thanks very much for your quick response. :+1:

If we have json output available, we can view it as HTML as many times as we want. By just sending a request to the template
No need to store extra HTML.

Still if you want then you can do debug of visualizer and download the html.

Perfect, Thanks again :slight_smile:

Thank you too, you gave a beautiful use case to think.

I have curated the above use case in the blog also.

Do let me know your thoughts.

2 Likes

Is it anyway to export this visualiser result as HTML and share with stakeholders who don’t have postman account?

@Veenadevi I’ve not seen a download / save option myself. It would be really handy to be honest.

There is one visualiser I use which displayed a load of columns and rows of data I have found I can do a select all and copy the data and paste it into excel which is the closest I got.

Sharing Execution reports to the stakeholders who don’t have postman is a real challenge

1 Like

@Veenadevi The other option is to use Newman on the command like with the HTML reporter. But its not as simple as being able to do it all in Postman.

Yes , I have a blocker of bearer token life time, by the time I export and execute its expired

@Veenadevi

This should not be a blocker, but you do need to be using a continuous integration tool like Jenkins or Azure Dev Ops.

The secrets you need to retrieve the token should be stored somewhere securely. Ideally using a product like Azure Key Vault or similar. Things like ‘clientId’, ‘clientSecret’, ‘tenantId’, ‘username’, ‘password’.

Those secrets are included as environment variables within Postman and tagged as secret, so they don’t get stored anywhere apart from your local machine. They won’t get copied up the Postman cloud or your code repository. (Keeps the info sec bods happy).

In your continuous integration pipeline, you would have the initial step of retrieving the secrets to include in the Newman command line which comes as the next step.

Using Azure Key Vault with Microsoft Dev Ops works seamlessly as they are both MS products.

Your Postman collection can be setup in various ways to generate a token before hitting the end point you really want to test.

You can use the inbuilt authentication options to generate a token. This will generate a new token for every request.

Or you can create an authentication request as the first test in your collection\folder which saves the token to an environment variable which can be re-used by the rest of the requests.

Or final option is to use a pre-request script with sendRequest to generate a new token. The advantage with this option is that if you have also saved the expiry date of the token to another environment variable, you can get it to check if its expired or not and retrieve a new one. Therefore, it will get a new token on the first request in the collection\run, but only get a new one if it thinks the token has expired.

The main crux here, is that you really shouldn’t need to copy and paste these reports though. The main point is that the API tests should be part of your deployment pipeline, not separate. The collection and environment json files should ideally be stored in the same code repository as the main application code and your CI tool should report on all aspects of the build and testing in one place.

1 Like