Generate HTML report

I want to generate HTML report for APIs with the help of postman application.

I want to run my collection and environment simultaneously and generate HTML report of pass and failure results.

please guide me.

@amit.servify Have you tried using Newman (The command line companion for Postman) ?

You can refer to the docs and generate HTML reports using newman!

If you need further assistance then feel free to ask!

Hi,

I want to execute my collection and saved environment variable parallelly.

for example:

I have one user registration call -> then I get one authoken from the server for that user and I use that authoken in further steps.

This kind of scenario is possible in newman command line .

Please guide me.

Hello,

Using Newman you can execute the exported postman collection which will be in format in and command line… But is there any command to run the collection.json and generate HTMl report using Newman? If yes, Kindly share it.

Thanks in advance.

*which will be in collection-name.json format which can be executed from CLI … How to generate HTMl report ? What’s the cmand for the same ? Kindly share…

@tejguddigerekempaiah I don’t know if you’ve found an answer to this yet, but yes! This is possible with Newman. You will need to install the newman-reporter-html.

After installing, you can export report results as HTML by running the below command.

newman run <path-to-your-collection> -r html

It can also be done within your code as such

const newman = require('newman');
 
newman.run({
    collection: require('./examples/sample-collection.json'), // can also provide a URL or path to a local JSON file.
    reporters: 'html',
    reporter: {
        html: {
            export: './htmlResults.html', // If not specified, the file will be written to `newman/` in the current working directory.
            template: './customTemplate.hbs' // optional, this will be picked up relative to the directory that Newman runs in.
        }
    }
}, function (err) {
    if (err) { throw err; }
    console.log('collection run complete!');
});