POSTMAN Flashcards

1
Q

What is Postman?

A

Postman is a collaboration platform for API development. It is a popular API client and it enables you to design, build, share, test, and document APIs.

Using the Postman tool, we can send HTTP/s requests to a service, as well as get their responses. By doing this we can make sure that the service is up and running.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why Postman?

A
  1. Free: It is free to download and use for teams of any size.
  2. Easy: Just download it and send your first request in minutes.
  3. APIs Support: You can make any kind of API call (REST, SOAP, or plain HTTP) and easily inspect even the largest responses.
  4. Extensible: You can customize it for your needs with the Postman API.
  5. Integration: You can easily integrate test suites into your preferred CI/CD service with Newman (command line collection runner)
  6. Community & Support: It has a huge community forum
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the core components of an HTTP request?

A
  1. HTTP methods – Set of request methods to perform desired action for a given resource (GET, PUT, POST, DELETE)
  2. Uniform Resource Identifier (URI) – Describes the resource
  3. HTTP Version, (example- HTTP v1.1)
  4. Request Headers, (example- Content-type : application/json, Content-Length : 511)
  5. Payload – It is basically a Request Body which includes message content.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

State The Core Components of an HTTP Response?

A
  1. Status/Response Code – These are response codes issued by a server to a client’s request. For example, 404 means Page Not Found, and 200 means Response is OK.
  2. HTTP Version – describes HTTP version, for example-HTTP v1.1.
  3. Response Header – Includes information for the HTTP response message. For example, Content-type, Content-length, date, status and server type.
  4. Response Body – It contains the data that was requested by a client to server.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What API information is exposed in Web Developer tools?

A

Request headers, Response body, Response cookies

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What can we use to get API information from web developer tools into Postman?

A

Copy as cURL can get API information from web developer tools into Postman.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In which type of encoding does postman accept authorization credentials?

A

Postman accepts Base64 encoding only. This is provided inbuilt in postman or else you can also refer 3rd party websites to convert the credentials in base64.

=======

We use base64 particularly because it transmits the data into the textual form and sends it in easier form such as HTML form data. Also, we can rely on the same 64 characters in any encoding language that we use.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is meant by the term environment in postman?

A

An environment in postman is a set of key value pairs. You can create multiple environments in postman which can be switched quickly with a press of a button. There are 2 types of environment, global and local.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Can global scope variables have duplicate names in postman?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which one will be preferred in postman- a global variable or a local variable?

A

In postman, if 2 variables have the same name( one being local, other global) then the higher priority is of the local variable. it will overwrite the global variable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a Postman Collection?

A

A Postman Collection lets us group individual requests together. Simply it allows us to organize the requests into folders.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What do you mean by postman monitors?

A

The postman monitor is used for running collections. Collections are run till specified time defined by the user. Postman Monitor requires the user to be logged in. Monitor reports are shared by users over email on a daily/monthly basis.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What do you understand by the term Postman Collection runners?

A

A postman collection runner is used to perform Data-driven testing. The group of API requests are run in a collection for the multiple iterations with different sets of data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Can local variables be imported in Postman Monitors

A

Yes. Postman monitors allow to import local variables but it does not allow to import global variables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Why is it not preferred to save work in Postman cloud

A

It is not preferred to save your work in Postman cloud as company’s work is not allowed to be leaked and remain 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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the purpose of status code 304?

A

It means NOT MODIFIED. It is used to reduce network bandwidth usage in case of conditional GET requests. Response body should be empty. Headers should have date, location etc.

17
Q

Define status code 201?

A

It means created, when a resource is successfully created using POST or PUT request. It returns a link to a newly created resource using the location header.

18
Q

When do we use global variables, collection variables, and local variables?

A

Global variables are general purpose variables, ideal for quick results, and prototyping. They are used while passing data to other requests.

=======-
Collection variables can be mostly used for storing some constants that do not change during the execution of the collection. They are used for constants that do not change during the execution and also for URLs / authentication credentials if only one environment exists.
=======-
=======-
Local variables are only available within the request that has set them or when using Newman/Collection runner during the entire execution. They are used whenever you would like to override all other variable scopes.

19
Q

How do you remove local variables?

A

Local variables are automatically removed once the tests have been executed.

20
Q

How can we stop executing requests or stop the collection run?

A
postman.setNextRequest(null);
21
Q

What is the difference between form data and x-www-form-urlencoded ?

A

The difference between the form data and x-www-form-urlencoded is that the url will be encoded when sent through x-www-form-urlencoded.

22
Q

Where are query parameters stored in a GET request

A

Query parameters are stored in the URL in a GET request.

23
Q

How can we access a Postman variable?

A

We can access a Postman variable by entering the variable name as {{var}}

24
Q

What is the HTTP response code for a POST request with incorrect parameters?

A

400 Bad Request is an ideal response code for request with incorrect parameters.

25
Q

How can you iterate a request 100 times in Postman?

A

By using Collection Runner

26
Q

How can we organize requests in Postman?

A

We can organize requests in Postman with the Collections.

27
Q

Which programming language is used for Postman tests?

A

JavaScript

28
Q

What will execute first in a Collection Run?

A

Pre-request scripts at the Collection level are executed first in a Collection run.

29
Q

What are some of the JS libraries available in Postman?

A

Lodash, Moment, GUID

30
Q

Which tool can be used to run Postman Collections in Jenkins?

A

Newman can be used.

31
Q

How can we log requests and responses in Postman

A

We can view requests logs and response logs through the Postman Console window.

32
Q

What is GUID?

A

GUID stands for Global Unique Identifier. It is basically hexadecimal digits separated by hyphens. GUID solves the purpose of uniqueness.

In Postman, we use this to generate and send a random value to APIs.

{
"id": "{{$guid}}",
}