API Testing Using Postman and Newman

Velotio Technologies
Velotio Perspectives
8 min readMar 8, 2019

In the last few years, we have an exponential increase in the development and use of APIs. We are in the era of API-first companies like Stripe, Twilio, Mailgun etc. where the entire product or service is exposed via REST APIs. Web applications also today are powered by REST-based Web Services. APIs today encapsulate critical business logic with high SLAs. Hence it is important to test APIs as part of the continuous integration process to reduce errors, improve predictability and catch nasty bugs.

In the context of API development, Postman is great REST client to test APIs. Although Postman is not just a REST Client, it contains a full-featured testing sandbox that lets you write and execute Javascript based tests for your API.

Postman comes with a nifty CLI tool — Newman. Newman is the Postman’s Collection Runner engine that sends API requests, receives the response and then runs your tests against the response. Newman lets developments easily integrate Postman into continuous integration systems like Jenkins. Some of the important features of Postman & Newman include:-

  1. Ability to test any API and see the response instantly.
  2. Ability to create test suites or collections using a collection of API endpoints.
  3. Ability to collaborate with team members on these collections.
  4. Ability to easily export/import collections as JSON files.

We are going to look at all these features, some are intuitive and some not so much unless you’ve been using Postman for a while.

Setting up Your Postman

You can install Postman either as a Chrome extension or as a native application.

Later, can then look it up in your installed apps and open it. You can choose to Sign Up & create an account if you want, this is important especially for saving your API collections and accessing them anytime on any machine. However, for this article, we can skip this. There’s a button for that towards the bottom when you first launch the app.

Velotio Technologies
Velotio Perspectives

Velotio Technologies is an outsourced software and product development partner for technology startups & enterprises. #Cloud #DevOps #ML #UI #DataEngineering

Recommended from Medium


See more recommendations