Thursday, 15 December 2022

Newman with Postman.... a blessing!

  • Postman is a very good tool for api automation
  • But when it comes to execute via command line we have to use another tool newman.
  • And to share report in a nice format we will need the help of newman-reporter-htmlextra
  • https://www.npmjs.com/package/newman-reporter-htmlextra
  • Prerequisite tools
    • 1. Postman
    • 2. nodejs
    • 3. java

  • Install newman 
    • npm install -g newman
  • ref - https://support.postman.com/hc/en-us/articles/115003703325-How-to-install-Newman
  • Install newman reporter html exta
    • npm install -g newman-reporter-htmlextra
  • https://www.npmjs.com/package/newman-reporter-htmlextra
  • optional - To use htmlextra as a library, install the package as a dependency into a nodejs project's package.json file using:
  • npm install -S newman-reporter-htmlextra
  • Execute the script
    • newman run DDTLogin.postman_collection.json -e DDTLogin.postman_environment.json -d data1.csv -r htmlextra
  • Where 
    • DDTLogin.postman_collection.json postman : is collection name
    •  -e DDTLogin.postman_environment.json : is  -e option to specify env file and env file name
    •  -d data1.csv : is -d option to specify data file and data file name
    • -r htmlextra : -r option for report and name of htmletxra ****

https://learning.postman.com/docs/running-collections/using-newman-cli/newman-options/



No comments:

Post a Comment

Jmeter - Get/print/display the Thread index nad loop index / ip address of current machine while executing script

Hi, If we need to print  Current thread count/index while execution in result -  thread No: (${__threadNum})  and if current loop count/ind...