Postman is currently one of the most famous tools for API Testing. This tool is very popular if you need to dissect the RESTful API made by others or if you want to test an API you have made yourself.
But what do we exactly mean by an API. API means Application Programming Interface which helps software applications to interact with each other via API Calls.
Postman began as a side project to simplify the workflow of an API during testing and development.
After reading this short introduction you must be wondering why Postman is so popular among the crowd.
There are various reasons for the popularity. Let’s begin with discussing reasons first, then we will go to Step by Step installation guide of Postman.
Using Postman just need you to log-in into your account and here you go. You can access all your files anytime, anywhere. All you need is a postman desktop application.
Postman helps to organize test suites by allowing collection creation for API calls. Each collection can create multiple request and sub folder.
It is possible to create, export, import collections. Thus, making it easier to share files. Collections can be shared via direct link.
Having multiple environments aid in less repetition of tests as same collection can be used but for a different environment.
Test Checkpoints can be added to each API calls, thus ensuring test coverage.
Using Collection Runner or Newman helps in automating testing where tests can run in multiple iterations, saving time for repetitive tasks.
Postman is able to support Continuous Integration.
After having such a detailed discussion, You must now a bit convinced that Postman is not a bad choice. In Fact it deserves to be in the top 5 list.
Let’s quickly start discussing steps to install and download Postman. So, that we can start working on it.
Postman is an open-source tool. Follow the steps below to install the tool:
- Follow the link https://www.getpostman.com/downloads/ to download the Postman software. Choose your desired platform from Windows, Mac or Linux. If you chose Windows, choose from 32 -bit or 64-bit.
Once downloaded, run the executable file.
- There are 3 ways to use Postman:
a. Signup and create your own account and start using Postman
b. Sign-in using Google Account and start using Postman.
c. Skip Sign-up and sign-in procedure and directly start using the software.
In the 3rd case, you won’t be able to access your collections. So, it is better to create an account or sign-in using Google credentials so that your collections are saved and can be accessed later.
- Select the workspace tools you need, and click on Save My Preferences.
- You will see the startup screen.
How to Use Postman
If you clearly observe the screenshot below , you will see that the workspace itself is a puzzle with so many pieces. In order to solve this you need to have a basic knowledge of the basic pieces. Let’s start discussing a few of the important components on the workspace.
- New: This is used to create new building blocks like request, collection or an environment or alternatively you can also create advanced components like Documentation, Mock Servers, Monitor.
- Import: This helps to import a collection or an environment. It supports following types of import options:
a. Import from a File
b. Import from a folder
c. Import from a link
d. Paste Raw Text
- Runner: It is possible to run automation test through collection runner.
- Open New: This button helps you to open a new tab, Postman Window or Runner Window.
- My Workspace: There are 2 ways to create a Workspace: either a Personal workspace or as a Team. There is also an option to view the Workspace.
- Invite: You can collaborate on a workspace by simply inviting the team members.
- History: Past requests sent by you will be displayed in this section. There is also a toggle switch to save responses. This helps in tracking actions easy.
- Collections: Collections helps in organizing test suites, where collection can consists of multiple subfolders and multiple requests.
- Request Tab: This tab displays the title of the request you are working on. By default “Untitled Requests will be displayed for requests without any title.
- HTTP Request: This is a drop down menu listing different types of HTTP Requests. Some of the requests that are available are: GET, POST, DELETE, PUT, HEAD, OPTIONS and many more. Most commonly that are used are GET and POST.
- Request URL:This is the text box asking for the URL with which API will communicate with. This is often referred to as endpoint.
- Save: In case of changes in a request, click on the save button to commit the new changes and prevent them from being lost or overwritten.
- Params: This holds the parameters like key values for the requests.
- Authorization: Proper authorization is needed to access APIs. Authorization can be done using any credential set like username- password, bearer token etc.
- Headers: You can customise headers as per the need of your organization. Headers like Content Type JSON can be added.
- Body: This is the main section that can be customised in a HTTP Request. Most commonly POST Request requires customisation inside the body of request.
- Pre-request Script: Pre-request scripts are used for setting environment to ensure tests will be executed in the correct environment. So, these are the scripts that are executed before running actual request.
- Tests: These are the scripts that are executed during request to set up checkpoints like to verify if the retrieved data is as expected, if the response status is ok and many more.
With this we are done with a basic introduction of Postman. Now, in the next blog post article we will focus on hoe to actual get started with running request in Postman.
Till then, get ready with the setup and Happy Coding!!!