DEV Community

Hassan BOLAJRAF
Hassan BOLAJRAF

Posted on

Azure DevOps | Installing Postman and Newman using npm

Note
You can check other posts on my personal website: https://hbolajraf.net

Installing Postman and Newman with npm

In this guide, we will walk through the steps to install Postman and Newman using npm (Node Package Manager) and how to run a Postman collection using Newman.

Prerequisites

  • Node.js and npm installed on your system.

Install Postman

Postman provides a user-friendly graphical interface for creating and managing API requests and collections. To install Postman:

  1. Open your terminal or command prompt.

  2. Use npm to install the Postman command-line tool:

   npm install -g postman
Enter fullscreen mode Exit fullscreen mode
  1. Once the installation is complete, you can run Postman by typing postman in your terminal.

Install Newman

Newman is a command-line collection runner for Postman that allows you to run and automate Postman collections. To install Newman:

  1. Open your terminal or command prompt.

  2. Use npm to install Newman globally:

   npm install -g newman
Enter fullscreen mode Exit fullscreen mode
  1. Once the installation is complete, you can use Newman to run Postman collections from the command line.

Run a Postman Collection

Now that you have Postman and Newman installed, let's run a Postman collection using Newman.

  1. Export a Postman collection from the Postman application if you haven't already. Save it as a JSON file (e.g., example_collection.json).

  2. Open your terminal or command prompt.

  3. Run the Postman collection using Newman:

   newman run example_collection.json
Enter fullscreen mode Exit fullscreen mode

Replace example_collection.json with the name of your Postman collection file.

  1. Newman will execute the requests in your collection and provide a summary of the results, including the number of requests run and their status.

What Next?

You've successfully installed Postman and Newman and used Newman to run a Postman collection from the command line. This is useful for automating API testing and integration into your CI/CD pipelines.

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay