Professional Documents
Culture Documents
1) NEWMAN
a. CLI TOOL DEVELOPED FOR POSTMAN
b. USED TO GENERATE CLI REPORTS (CLI=Command Line Interface)
c. USED TO INTEGREATE API AUTOMATION WITH CI/CD TOOLS LIKE JENKINS, BAMBOO etc
d. USED TO GENERATE HTML REPORTS
e. FOR BETTER VISUALIZATION OF API TEST REPORTS
f. FOR EASE OF DEBUGGING & TROUBLESHOOTING API TESTS
g. FOR FASTER EXECUTION OF API TESTING
3) All HTML reports will be created in NEWMAN folder, mostly in C:\Users|<username> ; You can find this path
when you visit Start Run cmd Press ‘ENTER_KEY’ Here, you will find the same path
5) FOR UBUNTU OS, execute the following commands to install Node JS & NPM
i. sudo apt update
ii. sudo apt install nodejs
iii. sudo apt install npm
9) TO INSTALL HTMLEXTRA REPORTS USING NEWMAN, execute below command for html installation
npm install -g newman-reporter-htmlextra
10) WE CAN RUN THE BELOW NEWMAN COMMAND TO GENERATE HTML REPORT
a. newman run collection.json -r htmlextra
OR
b. newman run collectionPublicLinkURL -r htmlextra
11) WE CAN RUN THE BELOW NEWMAN COMMAND TO GENERATE JUNIT REPORT
a. newman run collection.json -r junit
12) WE CAN RUN THE BELOW NEWMAN COMMAND TO GENERATE JSON REPORT
a. newman run collection.json -r json
NEWMAN TOOL – CLI COMPANION FOR POSTMAN TOOL
Note:
collection.json is the full path of the collection downloaded from Postman to your computer
collectionPublicLinkURL is the public URL generated in Postman Collection by clicking on Share button
13) WE CAN RUN THE BELOW NEWMAN COMMAND TO GENERATE JSON/CLI REPORT
a. newman run collection.json
OR
newman run collection.json -r cli
OR
b. newman run collectionPublicLinkURL
14) WE CAN RUN NEWMAN COMMAND TO GENERATE CUSTOM PROJECT TITLE IN THE REPORT
15) To run a collection with multiple # of iterations (load testing), run the below commands:
a. newman run collection.json -n no.of iterations (use this command to generate CLI report)
b. newman run collection.json -n no.of iterations –r htmlextra (use this command to generate HTML
report)
Note: “no.of iterations” write the number of iterations as per your requirement
Note: environmentName.json is the full path of the environment file downloaded from Postman to your computer
a. newman run collection.json -d fileName -n no.of iterations (to generate CLI report)
b. newman run collection.json –d fileName -n no.of iterations –r htmlextra (to generate HTML report)
Note: fileName is the full path of the data driven testing file (CSV or JSON) created on PC
c. newman run collection.json -d fileName -n no.of iterations -e environment name (to generate CLI
report)
d. newman run collection.json -d fileName -n no.of iterations -e environment name –r htmlextra (to
generate HTML report)
18) To run a collection with one of its folder name [with or without environment parameter],
c. newman run collection.json -delay delaytime (to generate CLI report with 1 iteration)
d. newman run collection.json -delay delaytime -n no.of iterations (to generate CLI report)
e. newman run collection.json -delay delaytime -n no.of iterations -r htmlextra (to generate HTML report)
f. newman run collection.json -n no.of iterations --delay-request [number] –r htmlextra (to generate
HTML report)
21) To execute Newman commands from Jenkins tool, follow below steps:
a. Install Jenkins on your computer
b. Ensure JDK v11 is installed on your computer
c. During installation of Jenkins, change Java Path to JDK v11 bin path in installation wizard
d. Launch Jenkins, after installation is completed
e. Create a new project & configure the windows batch command as below:
cd C:\Users\IQT\AppData\Roaming\npm\node_modules\newman\bin
newman run collectionPublicLinkURL -r htmlextra
f. Click on Apply & Save buttons
g. Run the build in Jenkins
h. Alternatively, refer this https://support.postman.com/hc/en-us/articles/360036847714-Running-a-
collection-through-Jenkins-
Note: IQT in the above path is the name of the logged in user on the computer ; replace it with your logged in user name
where newman is installed [this is the newman path]
https://learning.postman.com/docs/running-collections/using-newman-cli/command-line-integration-with-newman/
https://www.npmjs.com/package/newman-reporter-htmlextra