If you look around on the Internet, you can see that a very large number of services use APIs.  A mobile application of an ecommerce website uses an API; Anything with a social login uses an API;  even the ads that you see on the Internet use APIs!

By creating an API for your service, you enable third-party developers to create applications based on your service. For example, the social newspaper Frrole uses the Twitter API to generate contextual insights by analyzing a large volume of tweets.
 

API_description

 

Creating & Testing APIs

Although there are a number of ways in which an API can be created, a Web API is usually created by using the REST (Representational State Transfer) framework. The REST framework sets a set of guidelines that should be followed while creating an API. As the prime motive of creating an API is to enable other applications to use the services, every stage of the API development process requires testing for functionality, exception handling and security.

Make Testing Easier With Postman Tool

What is Postman Tool? How does it work? 

At the first glance, Postman testing tool is a simple GUI for sending HTTP requests and viewing responses. But deep down, Postman is built on an extensive set of powerful tools that are very easy to use. Postman allows you to organize your API requests into collections and folders share common values across requests with environment variables, script tests with the built-in node.js based runtime, and automate it all with its very own CLI – Newman.


The Postman testing tool is a complete API development platform with various built-in tools that support every stage of the API lifecycle. Postman allows you to design, mock, debug, automatically test, document, monitor and publish the APIs - everything from one place. Postman can be accessed through native apps for MacOS, Linux and Windows.

postman_description

 

Postman’s complete API development platform will allow you to create requests, build and manage collections, and govern the complete life cycle of your APIs.

Evolution of Postman Testing Tool

The postman started out as a Postman Chrome App when it first came out, used along with the Postman Interceptor Chrome extension. The Google Postman extension was widely accepted and was one of the most sought after tool for testing. Over the years, the API ecosystem evolved, and with this the Postman native apps' capabilities were also improved to surpass the performance of the postman chrome extension. 

However, if you are still using the Postman Google Chrome app, you may notice a banner on top which says  "Chrome apps are being deprecated. Download our free native apps for continued support & better performance." 

This is something that happened when Google announced their not-so-great plans to end support for Chrome apps for Windows, Mac & Linux users. In response to the deprecation of Postman Google Chrome extension, they introduced native apps for Windows, Mac and Linux users and encouraged their users to begin the migration. The new Postman native apps covered all the features & functionalities of the postman chrome extension, and in many cases, the native app was even better than the original Chrome app.

native apps

With the native Postman application performing better than the Postman Chrome app, and the process of migrating being easy (takes less than minute!), it is time to say Goodbye to Postman extension and switch to their native apps.

Why Postman?

Test Suites - Create them with ease

In order to ensure that your API is working as expected, Postman tool allows you to create collections of integration tests. For each of these tests, that are run in a specific order, an HTTP request is made and the assertions written in JavaScript are used to verify the integrity of the code. You also have the freedom to manipulate the data that you receive, courtesy of the assertions written in JavaScript.

postman_screenshot

 

Testing on different environments? No Problem!

How often do you find that since your local environment is configured a little differently than the test server, your test collection that runs perfectly against your local environment  faces problem when your run it against a different one. Postman testing tool allows you to store certain information about the different environments that you use and automatically insert the correct environment configuration for the test collection that you are running. 

postman_screenshot

 

Data Storage 

You may have an API which requires some specific data received from another API. Postman tool allows you to store such data from previous tests into global variables, and these can be used in a similar way as environment variables. You can either store the response or a part of the response and use it for the subsequent  API calls. 

Better Integration

The Postman testing tool has a unique interface that allows you to easily run a collection of tests right from the command line. Newman, which is Postman's very own Command Line Interface (CLI) enables running these tests on systems that do not have a GUI. Also, Newman gives you the ability to run a collection of these tests right from within most build tools. 

Newman - Continuous Integration in Postman

Newman is basically a Command Line Interface tool which will allow you to run Postman collections directly from the command line.  Their official website describes Newman as - "Newman is a command line Collection Runner for Postman. Newman allows you to run collections in the same way they are executed inside a Postman collection runner. Since we all know that a Continuous Integration helps us to combine different codes and execute different tests continuously. This combination of tests and code is usually a success due to continuous integration, which in Postman is done by Newman.

Newman is built to integrate easily with your build systems and continuous integration server. It allows developers to get a quick feedback about the performance of the APIs after changes in their code. With the help of Newman, it gets integrated with the CI and after that if any changes are pushed, CI will run the postman collections with Newman. 
 

Shri Ganesh HegdeJun 17, 2019