Postman Tutorial for Beginners to perform API Testing: Part 1

Postman Tutorial for Beginners to perform API Testing: Part 1

2019 / 9 / 4

API, API Testing, Postman

    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.

  1. 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.

  2. Postman helps to organize test suites by allowing collection creation for API calls. Each collection can create multiple request and sub folder.

  3. It is possible to create, export, import collections. Thus, making it easier to share files. Collections can be shared via direct link.

  4. Having multiple environments aid in less repetition of tests as same collection can be used but for a different environment.

  5. Test Checkpoints can be added to each API calls, thus ensuring test coverage.

  6. Using Collection Runner or Newman helps in automating testing where tests can run in multiple iterations, saving time for repetitive tasks.

  7. 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:

  1. Follow the link 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.

Postman open-source tool

  1. Once downloaded, run the executable file.

Installing Postman

  1. 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.

Postman Sign Up

  1. Select the workspace tools you need, and click on Save My Preferences.

Postman Workspace

  1. You will see the startup screen.

Postman 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.

  1. 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.
  2. 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
  3. Runner: It is possible to run automation test through collection runner.
  4. Open New: This button helps you to open a new tab, Postman Window or Runner Window.
  5. 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.
  6. Invite: You can collaborate on a workspace by simply inviting the team members.
  7. 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.
  8. Collections: Collections helps in organizing test suites, where collection can consists of multiple subfolders and multiple requests.
  9. 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.
  10. 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.
  11. Request URL:This is the text box asking for the URL with which API will communicate with. This is often referred to as endpoint.
  12. 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.
  13. Params: This holds the parameters like key values for the requests.
  14. Authorization: Proper authorization is needed to access APIs. Authorization can be done using any credential set like username- password, bearer token etc.
  15. Headers: You can customise headers as per the need of your organization. Headers like Content Type JSON can be added.
  16. 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.
  17. 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.
  18. 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!!!

You might also like