Newman API automation and generate HTML reports (Step-by-Step):
Step 1:
Make sure you have the collection’s url, for example:
https://api.postman.com/collections/12510727-6552109ca-2e60-4481-9a6d-37d6ad8feka6?access_key=PMAT-ABCDEFGHIJKLMNOPQRSTUVWXYZ
Step 2:
Download Nodejs and install it on your system.
Step 3:
Open your windows terminal and install the Newman.
npm install -g newman
Step 4:
Set the Environment Path in the User Variables.
Adding in the Path variable under Environment Variable solve the problem even if we don’t add in NODE_PATH
C:\Users\ yourusername \AppData\Roaming\npm
After doing this reopen command prompt
Step 5:
Open your windows terminal and install the Newman.
npm i -g newman-reporter-html
Step 6:
Now run this command in your terminal,
newman run "https://api.postman.com/collections/12510727-6552109ca-2e60-4481-9a6d-37d6ad8feka6?access_key=PMAT-ABCDEFGHIJKLMNOPQRSTUVWXYZ" --disable-unicode -r html
Step 7:
Your HTML file will be generated in the following directory:
C:\Users\yourusername\newman
Leave a comment