POSTMAN is an API/Web services testing tool which is used for testing APIs by sending a request to the web server and getting the responses back.

Before knowing about POSTMAN in detail we must know what is API and what is web service.

API – Application Programming Interface is a software intermediary that allows two applications or components to communicate with each other in a set of defined methods

Web service – Web service is a service offered by an application installed on a particular device or server to another device or client application. These services can be implemented in many ways and the most prominent implementations are through  SOAP(Simple Object Access Protocol) service and REST(Representational State Transfer) service.

Postman workflow

Why We have to do API Testing?

  • In order to make sure live API endpoints are up, fast and returning the data that are expected.
  • Iterating on API tests will make applications stronger and more comprehensive, which raises the product quality.
  • API testing during development can reveal issues with your API, server, other services, network and more that may not discover or solve easily after deployment.
  • Reusing API tests facilitates collaboration among teams and provides are more comprehensive and accurate testing action.
  • GUI tests can’t sufficiently verify functional paths and back-end APIs/services associated with multi-tier architecture.

There are ample number of tools available for web service testing and this blog gives an overview of  POSTMAN-REST client tool which follows Representational State Transfer architecture for testing web services.

POSTMAN Setup

Postman can be installed in two different ways,

  • As a Standalone application
  • As Chrome extension

But the most recommended one for installation is as a “Standalone application”.

POSTMAN  GET and POST Request

Postman is lightweight and easy to use offers a very user-friendly interface with many features. Next, we are going to learn to create a GET request and POST request in Postman.

Creating New GET Request
  • A new request can be created by clicking the “New” option from the header or by clicking “Request” option from the popup. 

New request popup

  • In the “Save request”popup, enter the request name and the description for which the request is created.
  • Enter the Collection name in which the requests need to belong and click “+Create Collection” option then Save. The below snapshot shows the save collection.

Request name popup

  • Select the created request can be viewed from the Collection in the sidebar.
  • By default, the request which you enter will be a GET request and specify the URL for ‘GET’ request then click the ‘Send’ button.
  • Select the created request can be viewed from the Collection in the sidebar.
  • By default, the request which you enter will be a GET request and specify the URL for ‘GET’ request then click the ‘Send’ button.

default get request

Our first GET request is created and the response for the created request can be seen in Pretty, Raw and Preview formats.

In Pretty format, the content will be in a readable format with colored keywords. Raw format is the same as pretty without any colorful keywords and Preview shows the response preview of the browser.

response

Creating a POST Request

If you are about to use a sensitive information then POST request is preferred. Unlike ‘GET’ request POST request involves the addition, deletion, and update of information to the server.

  • In the request, select the request method POST and enter the URL.

Post request

  • Click Body tab for adding additional information for our POST request.
  • We have to send the additional information in the correct format in which the server expects so click Raw and select the format type as JSON (format type varies based on the request which we send).
  • Enter the below information in the JSON body and press send.

{

“FirstName” : ”William”,

“LastName” : “James”,

“Password” : “admin”,

“Email” : “admin@123”

}

Response body with code

You will receive the response as 201 Created as you have added a new record through POST request.

Post response

There are many methods available to send the data through POST request and the above method is one among them.

API testing helps you to ensure the APIs of the application is robust and quality delivery.

References:

https://www.mulesoft.com/resources/api/what-is-an-api

https://blog.restcase.com/why-api-testing-is-important-in-your-development-proces/

http://toolsqa.com/postman-tutorial/

https://medium.com/@faz540/writing-automated-api-tests-using-postman-for-beginners-step-1-the-basics-making-our-first-get-cef922e5e418

https://www.guru99.com/webservice-testing-beginner-guide.html

Subscribe to our blog

TRY QA TOUCH FOR JIRA CLOUD Go to Atlassian Marketplace
Shanila

Shanila

Shanila is a Certified Software Tester (ISTQB Certified) at DCKAP. She is passionate in delivering a high quality products to the end customers which makes her proud and happy so she choosed her career as "Software testing". She is a food lover and likes playing carrom.

Leave a Reply

avatar