Getting following error "newman: "html" reporter could not be loaded."

Hello there,

i have integrated newman + html-reporter with Jenkins. newman: “html” reporter could not be loaded is the error am getting and job is failed.

newman and newman-reporter-html are at the same level

image

The command am using is

newman run collection.json -e env.json -d data.csv --reporters cli,html --reporter-html-export “reports/report.html”

Below are the dev dependencies from package.json

“devDependencies”: {
“newman”: “4.4.0”,
“newman-reporter-htmlextra”: “1.5.5”,
“newman-reporter-html”: “1.0.2”
}

node -v : v8.12.0
npm -v : 6.4.1

Does the other reporter show the same error?

yes, other one shows shows the same error.

Boo :pensive:

Not sure about Jenkins but what I know of that error, is that I’ve seen it when I was creating the htmlextra reporter when I’d messed up something in the index.js file or when it’s not installed in the correct place (where Newman is).

I would suspect it’s the latter but like I said, I’m not too sure about Jenkins config / workspaces / where the script runs. :pensive:

Thanks Danny.

In my local computer(Win 10) html reporter works fine. But for “htmlextra” same issue is shown in my local computer. index.js is attached. can you suggest me any workaround?

If you grab the latest version of the htmlextra reporter and globally install this, it should just work.

npm i -g newman-reporter-htmlextra

If there has been local changes to that file, then it might not work but if it’s the latest 1.5.5 version, It should work fine.

Its working after installing globally in my local computer and Jenkins too, Thanks :grinning:

1 Like

Awesome! Let me know if you have any problems/improvements for the htmlextra reporter :slight_smile:

1 Like

Hi Danny, I’m triggering my collection on both postman and CLI. And in both the Execution report i.e. in Postman Collection Runner it shows as “PASS” with Status code 200 but in Newman Report( i.e. html and html extra) shows as Response Code: 401 - Unauthorized.

SO could you please help me why so status code is different

Hey,

I might need some more information to help you… :slight_smile:

What command are you using to run Newman?
What versions of the Newman and the htmlextra reporter do you have?
Do you have any Auth details in an environment / global file?

Can you share any more details about the collection itself - The more information will help me to figure out what’s going on for you…I’m kinda blind at the moment :slight_smile:

Hey Hi Danny, Below are the CLI command m using to get the html and htmlextra report.

Step1 : Installed NodeJS
NodeJS Version : v10.16.0
npm version : 6.9.0

Step2 : Installed newman
$ npm install -g newman
newman version : 4.5.0

Step3 : newman-reporter-html
npm install -g newman-reporter-html Example : newman run https://www.getpostman.com/collections/631643-f695cab7-6878-eb55-7943-ad88e1ccfd65-JsLv -r html

Step4 : newman-reporter-htmlextra
npm install -g newman-reporter-htmlextra Example : newman run https://www.getpostman.com/collections/631643-f695cab7-6878-eb55-7943-ad88e1ccfd65-JsLv -r htmlextra

Thanks.
Mrityunjay

Are you able to post an image of the runner set up and the request details from the Postman Console.

It’s just really difficult to debug a problem that only you can see on your side :slight_smile: I don’t know the requests you are making and the way you have everything set up in your Postman instance.

The information you posted is helpful in terms of versions but the commands are just running the Postman Echo collection so it’s not really telling me much more.

The 401 message is telling me that you are using some form of authentication in the app for your requests. How are you add this and is this contained in the exported collection file you’re trying to run or in an environment / global file?

Hi Danny,

Please find all details of my Project.
I have attached Collection Link, Collection Runner Screenshot, OAuth2.0 Authorization, Global and Environment variables.

https://www.getpostman.com/collections/54b91de1f0adde17d397!

Hi Danny,

Could you please help me out with above attached inputs.

Thanks,
Mrityunjay

Hey @mrityunjayasahu ,

I’m going to close off this topic because this has moved past what the original post was asking.

I’ll DM you, this is just an authorisation problem and something that you’re doing in the app that’s doesn’t have anything to do with a Newman reporter.

1 Like