Postman is a tool that permits the user to create, use and test Rest APIs. It is accessible as a Chrome extension.

Postman permits the user to create collections of integration tests to guarantee that an API is working as expected. For each test, an HTTP request is made and test assertions will be written in JavaScript and then used to check the quality of code.

Postman also permits the user to store information from past tests into global variables. These variables can be utilized precisely like environment variables. For instance, there is an API that requires information received from another API. Users can store the response (or part of the response, since it is JavaScript) and utilize that as part of a request header, post body, or URL for the resulting API calls.

How postman has become an effective tool for API Testing

The following features have helped Postman become an effective tool of choice:

  • Accessibility – To access, one would just need to login to their own account making it easy to access files anytime, anywhere as long as a Postman application is installed.  
  • Collection Usage – Postman allows users to create collections for API calls. Each collection can create subfolders and multiple requests. This helps in organizing your test suites.
  • Combination – Collections and environments can be easily imported or exported to share files. A Simple link can also be used to share collections.
  • Establishing Environments – Having multiple environment statuses helps in less repetition of tests as one can use the same collection for a different environment. 
  • Creating Test Cases – Test checklists such as verifying for successful HTTP response status can be added to each API call which will help ensure test coverage.
  • Process Automation – Through the use of the Collection Runner or Newman, tests can be run in multiple iterations saving time for repetitive tests.
  • Data Debugging – Postman console helps check what data has been retrieved making it simpler to debug.
  • Continuous Integration – Development processes can be properly maintained with continuous integration support.

Following are the test conditions

  • Execute/update the following inputs
    • API call with valid input.
    • API calls with valid input that attempts illegal operations.(eg: create a resource with a name that already exists)
    • Update a resource with illegal valid data (eg: rename with existing name)
    • Delete a resource that doesn’t exist.
    • API calls with invalid input(eg: Missing or invalid authorization token) 
  • Validate the status code.
  • Destructive testing (Wrong content-type in the payload)
  • Overflow parameter values or Fields validation check (eg: Attempt to create a user configuration with a title longer than 200 characters)
  • Boundary value testing.
  • Execute with empty payloads.
  • Performance sanity(response is received in a timely manner within reasonably expected time as defined in the test plan)
  • Validate headers(Verify that HTTP headers are as expected)

Following methods to be worked with in Postman

  1. POST
  2. GET
  3. PUT
  5. VIEW
  6. COPY
  7. HEAD
  8. LINK
  10. LOCK
  11. UNLOCK

Most commonly used methods are

  1. POST
  2. PUT
  3. GET

Installation of postman in local machine

Download and install the tool from the below URL

Set up Postman environment variables

Problem Statement Solution & Implementation

We regularly experience various servers in our organization. These can be Staging, UAT, or PROD servers. Each server has various kinds of API requests. Since postman collections can have numerous requests inside it, imagine a scenario in which the URL changes, for instance, they change their server API URL specific to the environment(UAT or PROD) and update the tester regarding it.

For example, if there are some 200 requests, we want to change multiple times.  To run the requests successfully now we have to make the changes to every request included in those 200 requests, which consumes a lot of time. Considering it, which frequently get noticed, Postman being the best Open Source tool, has a feature to manage this in less time with automation and we will be a great idea to go to use the requests again

Set up environment variables

Distinguish the environment that you need to define. Variable names are wrapped with double curly braces{{ }}. For example, {{loginurl}}.

You’ll see the environment variables in the endpoint URL and Headers territories of the Postman Collection.

Below are the steps
Step 1:
Click on the Environment button(eye button) in the upper right of Postman and click Add on Top right corner.

Add VARIABLE, INITIAL VALUE and click the Add button.



First API Testing and How we do it.

In our first API test, we will send a POST request to create and then write basic JavaScript to confirm that the response returned is correct.

POST Method test case example:

This method is used to create employee data in the database


  • Select Method as POST
  • Enter Url as http://{{employeedata}}
  • Click on Body tab>Select raw>Select JSON : 
  • Inside body enter the following







Using Script Assertions

One of the advantages of using Postman is Test scripts can be written in JavaScript to validate the responses automatically.

For Postman API requests,.
pm.test() function is used to compose test details inside the Postman test sandbox. It can be used uniquely in the Tests tab, after the primary Postman request has been sent.

Sample Test script

  • To validate Response time
  • To Validate created details
  • To Validate Response time
 pm.test("Status code is 200", function () {;
pm.test("Validate created details in response", function () {
    var requestBody = JSON.parse(pm.request.body);
    var responseBody = pm.response.json();


pm.test("Response time is less than 1000ms", function () {


Newman Report with HTML generation

What is Newman? Get to know about Newman

Newman is a command-line Collection Runner for Postman. It permits users to execute and test in Postman Collections straightforwardly from the command-line. Newman can easily integrate with continuous integration servers and build systems.

Newman allows the collections to run the way they are executed inside the collection runner in the Postman.

How to Install Newman and Execution of Command-line.


To run Newman, ensure that you have NodeJS >= v4. A copy of the NodeJS installable can be downloaded from

Install NodeJS and NPM

  • Windows
  • MacOS
  • Newman
    • Open you Node Terminal and install globally
    • Command: $ npm install Newman –global;

Run the Postman Collection with Environment and Generate Newman Report

Step 1: To Run the Postman collection export collection in json format.

Step 2: Open Terminal, then navigate to the exported Postman file location and run the below command.

Command: $ newman run <collection-file-source> -e <environment-file-source> -r report.html

Step 3: After successfully executing the command, an HTML report will be generated in the same directory.

Step 4: Open the generated file with Chrome or Firefox browser.

Newman dashboard-postman

How may I help you?
    Type your message...