Postman is a free; HTTP Client-based software application primarily used to perform API testing. It supports testing of HTTP requests by utilizing GUI (Graphical User Interface) which can be executed and the responses can be validated. It also helps in collaborating among the team members for the development of API by providing a platform to design, develop, test, and document APIs.
When Postman was developed, it was originally a Chrome browser plugin. It extends its solution with the native version for both Mac and Windows.
A collection in Postman helps to group similar requests. It helps in systematically arranging the requests into folders.
An HTTP request is a program that the client makes to a name host located on a server. It works as a communication interface or a request-response protocol between a client and server. The primary use of the HTTP request is to access a resource on the server. To initiate the HTTP request, the client uses components of a URL (Uniform Resource Locator) that also includes the information needed to access the resource.
An example of the HTTP request:
A client (browser) sends an HTTP request to the server; then, the server responds to the client. The response sent by the server contains the status information about the request, and it can also contain the requested content.
The Payload of an API Module is the body of your request and response message. When making an API request, it contains the data you send to the server. You can send and receive Payload in various formats, for example, JSON or XML.
Application Programming Interface (API) is a software interface that enables two applications to interact with each other without any user intervention. It is a collection of software functions and procedures. API is defined as a code that helps two different software communicate and exchange data with each other.
There are also other requests COPY, HEAD, OPTIONS, LINK, UNLINK, PURGE, LOCK, UNLOCK, PROPFIND, VIEW
The path parameter defines the resource location, while the query parameter defines sort, pagination, or filter operations.
In the GET request, the query parameters are stored in the URL in Postman.
It can be accessed by using the variable name:
{{variable_name}}
The purpose of both of those types of requests is to send a list of name/value pairs to the server. Depending on the type and amount of data being transmitted, one of the methods will be more efficient than the other.
The x-www-form-urlencoded is used more generally to send text data to the server while form-data is used to send binary data, most notably for uploading files to the server.
400 Bad Request is an ideal response code for requests with incorrect parameters.
A Postman cloud is a common repository of companies to access Postman collections. In the Postman cloud, work can be saved instantly after logging in. Anyone from the team can access data/collections from anywhere.
It is not preferred to save your work in the Postman cloud as the company’s work is not allowed to be leaked and remains confidential. Security breaches can be experienced if Postman Cloud is used as Postman Cloud requires sign-in. Therefore Postman Cloud is discouraged for saving work and team workspace is highly encouraged.
Pre-request scripts are those scripts that are used for executing Javascript code before a request is run. It is used for performing pre-processing tasks like setting variables, parameters, headers, body data, etc
Following is the list of key limitations of Postman:
Postman contains a collection runner that is useful for automating API testing. It helps visualize the details of each iteration and test results. A postman collection runner is also used for Data-driven testing.
The Postman monitor feature is used for running collections until the user’s specified time. However, the user must be logged in to their account to use this feature.
Postman methods, also known as HTTP methods or HTTP verbs, represent the actions that can be performed on a resource through an API. Some common Postman methods include:
Workspaces are the areas/spaces given by Postman for team collaboration to work on a specific set of collections. It provides a way to logically separate requests or collections that are personal to the developer or the team so that the maintenance of requests is made easy.
In Postman, there are two sorts of workspaces:
Since global variables are global i.e. without any environment, global variables cannot have duplicate names. Local variables can have the same name but in different environments.
In Postman, we can log the variable values in the console by using the following command:
console.log(pm.variables.get("variable_name"));
In Postman, if 2 variables have the same name (one being local, the other global) then the higher priority is of the local variable. It will overwrite the global variable.
Yes, you can import local variables into Postman Monitors. However, global variables cannot get imported into Postman Monitors.
JavaScript is used for Postman tests.
The Postman Console window is used to view request logs and response logs.
Following is a test code to check whether the response status is 200 or not:
tests[“Status Code is 200”] = responseCode.code === 200;
In Postman, if two variables have the same name (one being local, the other global), then the higher priority is of the local variable. The local variable will overwrite the global variable.
The Postman monitor is used for running collections. Collections run till the specified time defined by the users. It requires the users to be logged in, and the users share the Monitor reports over an email on a daily or monthly basis.
The local variables are automatically removed once you have executed and completed the tests.
We can organize requests in Postman with the Collections.
The environment in Postman is a set of key-value pairs. Postman allows you to build multiple environments and switch among them with a click of a button.
The pre-request scripts at the compilation level are executed first in a collection run.
Yes, it is possible to reuse the authentication token for multiple requests.
In Postman, we can access the history of requests in the History tab provided on the Postman application.
Global variables are the general-purpose variables. They are used while passing data to other requests.
Collection variables are generally used for storing some constants that do not change during the execution of the collection like URLs if only one environment exists.
Local variables are the temporary variables and are only available within the request that has set them.
GUID is an acronym that stands for Global Unique Identifier.
The functional method is advised and recommended while writing tests in Postman. Although we can use JavaScript methods, there has been no notification that the JavaScript technique would no longer be supported.
No, the global scope never has duplicate/same names, while variables having local scope can have the same name in various environments.
Scope of a variable in Postman is defined as the boundaries it can access.
Copyright © 2023 - Proleed Academy | All Rights Reserved.