You are here: Ultra Guide>Automation Web>SettingUpNewmanAndNodeJS (19 Sep 2020, MiaArmstrong)Edit AttachTags
-- MiaArmstrong - 23 Jun 2020

Announcing Cake.Newman

Setting Up Newman and Node JS

Newman is a command line Collection Runner for Postman. It allows you to run and test a Postman Collection directly from the command line.

For official documentation:

https://www.getpostman.com/docs/v6/postman/collection_runs/command_line_integration_with_newman

In order to use newman you will need to set up Node in your command line.

Install Node: If you’ve never used node before, don’t fear. Node is a javascript runtime that allows you to write javascript applications and run them locally as well as on a server. Let's make sure we have Node installed:

  1. Open your terminal and type in where node (PC) or which node (MAC) then press Enter. If you have Node already the terminal will give you a location, if you don’t have it, it will give you some kind of error message. If you don’t have Node, use the following instructions to install it: Windows or MAC

  2. Once you have node installed, you can check to see what version of node you are running by entering node -v into the command line. Ensure that you are running at least version 6.x.x or higher. If not, update your version by following the instructions for updating on the pages linked to in Step 1, above.

Install Newman: After you install Node.js, Newman is just a command away. Install Newman from npm globally on your system, which allows you to run it from anywhere npm install -g newman (the -g means global) You can now run any collection from your file system. If you have a collection in postman, just export it

And then you can run it by using the command newman run mycollection.json (you will have to replace “mycollection” with the name and path of your collection. You can also change directories into the same directory as your collection and just use the command from there. Use the command cd mydirectory to change directories, replacing mydirectory with the name of the file you are moving into.

Happy Testing
Topic revision: r3 - 19 Sep 2020, MiaArmstrong
© 2020 Ultranauts - 75 Broad Street, 2nd Floor, Suite 206, New York, NY 10004 - info@ultranauts.co