Here is what you need to do to start executing the postman collection through newman on your system:
1. Install NodeJS – https://nodejs.org/en/download
. Click on the 32-bit or 64-bit Windows Installer package, depending on your
machine configuration. Skip this if NodeJS/npm is already installed on your
system.
2. Open a command prompt, and type “node -v” and "npm -v". These commands should work and provide version number if nodeJS installation is successful.
3. Run this command to install newman:
npm install -g
newman
4. Install npm package newman-reporter-htmlextra for
creating reports.
npm install -g newman-reporter-htmlextra
5. Pull/Export the collection, environment json (if any), test data
csv (if any) files from the Postman UI or code repo (git) to your local and run this command
through the folder on your local where you have these files:
Command where you have collection json and environment json
file:
newman run "<<your_collection.json>>" -e <<your_environment.json>> -r htmlextra --reporters cli,junit,htmlextra --reporter-htmlextra-export TestReport.html
Command where you have collection json, environment json and
Test Data csv file:
newman run "<<your_collection.json>>"
-e <<your_environment.json>> -d <<your_TestData.csv>>
-r htmlextra --reporters cli,junit,htmlextra --reporter-htmlextra-export
TestReport.html
Comments
Post a Comment