Postman Interview Questions
Postman Interview Questions
The Postman tool also facilitates us to send HTTP/s requests to a service and get their
responses. We can ensure that the service is up and running by using this.
PlayNext
Unmute
Duration 18:10
Loaded: 0.37%
Â
Fullscreen
Backward Skip 10sPlay VideoForward Skip 10s
o It is free: Postman is free software that we can use for API testing. It is free to
download and use for teams of any size.
o It is easy to use: Postman is an easy-to-use software tool. We can send HTTP
requests of various types (such as GET, POST, PUT, PATCH, etc.). We have to
download it, and we can send our first request in minutes. It also gives us the
ability to save environments for future use.
o Community & Support: It has a huge community forum for customer support
and extensive documentation.
o It is extensible: Postman facilitates us customizing it according to our needs with
the Postman API.
o APIs Support: It facilitates us to make any API call (REST, SOAP, or plain HTTP)
and easily inspect even the largest responses. It also helps manage the end-to-
end lifecycle of the API - starting from design to mocking to testing and finally
maintaining the APIs.
o Runtime Services: Postman provides Runtime Services that help us manage API
collections, environments, work-spaces, and different examples.
o Integration: Postman facilitates us to easily integrate test suites into our
preferred CI/CD tools and services, such as Jenkins with Newman (command-line
collection runner).
4) What is an API?
API is an acronym that stands for "Application Programming Interface". It is a set of
routines, protocols, and tools used for building Software applications. API is an interface,
so it specifies how one software program should interact with other software programs.
In other words, we can say that API is an Application Programming Interface that acts as
an interface between two software applications and allows these two software
applications to communicate with each other. API is a collection of software functions
that another software program can execute.
5) What are the various authorization methods
provided by Postman?
Postman provides the following API request authorization options:
o API Key
o Oauth 1.0
o Oauth 2.0
o Bearer Token
o Basic auth
o Digest auth
o Hawk Authentication
o AWS Signature
o NTLM Authentication
o Postman
o SoapUI
o Katalon Studio
o Tricentis Tosca
o Apigee
o Jmeter etc.
8) How can you access the Postman variables?
We can access the Postman variables by using the variable name as:{{variable_name}}
o GET
o POST
o PUT
o PATCH
o COPY
o DELETE
o HEAD
o OPTIONS
o LINK
o UNLINK
o PURGE
o LOCK
o UNLOCK
o PROPFIND
o VIEW
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.
o HTTP methods: It is a set of request methods used to perform needed action for
a given resource (GET, PUT, POST, and DELETE).
o Uniform Resource Identifier (URI): It is a kind of address that describes the
resource.
o HTTP Version: It specifies the version of the HTTP. For example HTTP v1.1
o Request Headers: It specifies the content type and content length of the
request. For example: Content-type: application/ JSON, Content-Length: 511
o Payload: It is used to specify the Request Body that includes message content.
o Status/Response Code: The server generates the status or response codes when
the client makes a request. For example, 404 means Page Not Found, and 200
means Response is OK.
o HTTP Version: It describes the HTTP version. For example: HTTP v1.1, HTTP v1.3
etc.
o Response Header: The Response Header includes the information for the HTTP
response message. For example, Content-type, Content-length, date, status, and
server type.
o Response Body: The Response Body contains the client's data requested from the
server.
1. console.log(pm.variables.get("variable_name"));
Collection variables are generally used for storing some constants that do not change
during the execution of the collection. These variables are used for constants that do
not change during the execution and URLs / authentication credentials if only one
environment exists.
Local variables are the temporary variables and are only available within the request that
has set them or when using Newman/Collection runner during the script execution.
These variables are used whenever we have to override all other variable scopes.
When you click on the "View More option" on the request, you will see options to save,
document, monitor, delete or mock the request. You can also select multiple requests by
using Command or Control button and then clicking on the request.
1. postman.setNextRequest(null);
o 200 (OK): Status code 200 specifies that the request was correct.
o 201 (Created): Status code 201 specifies that the value wrapped with the request
has been created in the database. Here, it is obvious that the request was correct.
o 204 (No Content): Status code 204 specifies that the request was correct and
received, but there is no content to send. It means there is no response to send
to the client by the server.
o 400 (Bad Request): Status code 400 specifies a bad request. A bad request
means that the syntax of the request was incorrect. It appears when we have sent
the wrong parameters along with the request URL or in the request's body.
o 401 (Unauthorized request): Status code 401 specifies an unauthorized request.
An unauthorized request is a request for which you are not authorized. This
status code appears when we are not authorized to access the server or enter the
wrong credentials.
o 404 (Not Found): Status code 404 specifies that the server was connected, but it
could not find what was requested. It simply means "request not found". This
status code normally appears when we request a web page not available on the
server.
o Get
o Post
o Put
o Delete
o Patch
o Head
o Delete
Example:
1. {
2. "id": "{{$guid}}",
3. }