Postman is a widely recognized tool for API testing, development, and documentation, empowering development teams to create, collaborate, and validate APIs efficiently. With over 7,000 job openings related to API testing and development, expertise in Postman is highly sought after. The average salary for professionals skilled in API testing and Postman is approximately ₹8,00,000 per year.
Below are the three categories into which these Postman interview questions are divided:
1. Basic Postman Interview Questions for Freshers
2. Intermediate Postman Tool Interview Questions
3. Advanced Postman Interview Questions for Experienced
Most Frequently Asked Postman Interview Questions:
- What is Postman?
- Define status code 201.
- What is executed first in a collection run?
- What is an API?
- What are the different types of API requests supported in Postman?
- Which tool can be used to run Postman Collections in Jenkins?
- Which programming language is used for Postman tests?
- How do you access variable values from a file inside pre-request and test scripts?
- How can you iterate a request 100 times in Postman?
- In Postman, if we have both a global and a local variable with the same name, which one takes precedence
Basic Postman Interview Questions for Freshers
1. What is Postman?
Postman is a widely used API (Application Programming Interface) development and testing tool that simplifies the process of working with APIs. It provides a user-friendly interface for creating, sending, and analyzing API requests and responses. Postman offers a range of features, including the ability to organize requests into collections, automate tests, and generate documentation for APIs
2. Define status code 201.
After successfully creating a resource using a POST or PUT request, the status code 201 indicates that the resource has been successfully created. The response also includes a location header, which provides a link to the newly created resource.
3. What is executed first in a collection run?
In a collection run, the pre-request scripts are executed first at the compilation level, before anything else.
4. What is an API?
API stands for ‘Application Programming Interface’. It is a modern system, process, and software development tool. API is an interface, that specifies how a software program should interact with other software programs. In other words, we can say that an API is an application programming interface that works between two software applications. It allows two software applications to communicate. An API is a collection of software functions that other software programs can perform.
5. What are the different types of API requests supported in Postman?
Postman allows the following types of requests, and they are GET, POST, PUT, PATCH, DELETE, COPY, HEAD, OPTIONS, LINK, UNLINK, PURGE, LOCK, UNLOCK, and PROPFIND.
6. Which tool can be used to run Postman Collections in Jenkins?
Newman can be used to run Postman Collections in Jenkins.
7. Which programming language is used for Postman tests?
JavaScript is used for Postman tests.
8. How do you access variable values from a file inside pre-request and test scripts?
To access variable values from a file within pre-request and test scripts in Postman, you can use the following commands:
In the pre-request script:
var fs = require('fs'); var jsonData = JSON.parse(fs.readFileSync('path_to_file.json', 'utf8')); pm.environment.set("variable_name", jsonData.key);
In the test script:
var variableValue = pm.environment.get("variable_name");
These commands read JSON data from a file and set it as an environment variable for later use in both pre-request and test scripts. Adjust ‘path_to_file.json’ and ‘variable_name’ to match your specific file and variable names.
Postman is available as a native desktop app for?
Postman API Testing Tool is currently for Mac, Window (32bit/ 64bit), and Linux
9. How can you iterate a request 100 times in Postman?
In Postman, you can run a request 100 times by using Collection Runner.
10. In Postman, if we have both a global and a local variable with the same name, which one takes precedence?
The local variable gains higher priority in specific situations, leading to the global variable’s value being overwritten.
11. What do you understand about ScratchPad?
Postman’s Scratch Pad is a convenient feature that lets you work seamlessly without the need for a connection to Postman servers. It offers a local space where you can efficiently perform your tasks with ease.
Get 100% Hike!
Master Most in Demand Skills Now!
12. When was the Postman originally developed?
Postman was initially designed as a Chrome browser plugin but has evolved its offerings by introducing native versions for both Mac and Windows platforms.
13. What are the various authorization methods provided by Postman?
The following API request authorization options are provided by Postman:
- API Key
- Oauth 1.0
- Oauth 2.0
- Bearer Token
- Basic auth
- Digest auth
- Hawk Authentication
- AWS Signature
- NTLM Authentication
14. What is the use of the collection in Postman?
A collection is used to group similar requests in Postman. It systematically arranges the requests into folders.
15. How can you halt the execution of upcoming requests or the entire collection run?
To stop the execution of the next request, you can use the following code:
pm.setNextRequest(null)
16. How can you access the Postman variables?
By using the variable name as:{{variable_name}}, we can access the Postman variables.
17. What is GUID?
A GUID, also known as a Global Unique Identifier, is a sequence of hexadecimal digits separated by hyphens. This unique identifier in Postman serves the purpose of ensuring absolute uniqueness.
18. What are some of the JS libraries available in Postman?
Some of the JS libraries available in Postman are
1) Lodash
2) Moment
3) GUID
19. What is the difference between the form data and x-www-form-urlencoded?
The main distinction between form data and x-www-form-urlencoded lies in how the URL is organized when transmitted via x-www-form-urlencoded.
Intermediate Postman Tool Interview Questions
20. What is the procedure to remove local variables?
Once you execute and complete the tests, the local variables are automatically removed.
21. What do you understand by the pre-request script?
Pre-request scripts are a powerful tool that allows you to run JavaScript code before sending a request. These scripts enable you to perform pre-processing tasks such as setting variables, parameters, headers, body data, and more, ensuring a smooth and efficient request execution.
22. What test code allows you to check whether the response status is 200 or not?
Below is a test code to verify whether the response status is 200 or not:
tests[“Status Code is 200”] = responseCode.code === 200;
23. What is the meaning of the term environment in Postman?
Postman uses the term environment to refer to a set of key-value pairs. Within Postman, you have the flexibility to create multiple environments, and switching between them is just a button-press away. These environments come in two types: global and local.
24. What is the purpose of the 304 status code?
The status code 304, known as Not Modified, is utilized in conditional GET requests to minimize network bandwidth usage. When this status is returned, the response’s body must be empty, and important information like dates and locations should be provided in the headers.
25. What is a binary form in POST methods? What is its usage?
POST methods utilize the binary form to facilitate the effortless transmission of data in a format that cannot be manually entered. This approach proves especially useful when dealing with large files, such as images or CSV files, within the POST request. The binary representation stands out as one of the simplest and most effective ways to send intricate data along with the request.
26. What is Basic Auth in Postman?
Postman offers a feature called Basic Auth, which is an authorization technique for HTTP user agents, similar to web browsers. With Basic Auth, you can easily associate your request with a username and password by providing fields to enter this information.
27. How are Query Params different from Path Variables?
Path Variables are used for identifying specific resources and Query Parameters are used for sorting or filtering the resources.
28. What are the different Request Method types in Postman?
The different Request Method types in Postman are as follows:
- Get
- Post
- Put
- Delete
- Patch
- Head
- Delete
29. What encoding is accepted by Postman in authorization credentials?
Postman exclusively accepts authorization credentials in Base64 encoding format, which it provides by default. If we do not want to use an inbuilt encoding system, we can refer to third-party websites for converting the credentials in base64 format.
30. What is the use of Postman monitor?
The Postman monitor allows users to run collections for a specified time period defined by them. To use it, users need to be logged in, and they can then share the monitor reports via email on a daily or monthly basis.
31. What is the significance of 301 status code?
The 301 status code signifies a permanent redirect from one webpage to another on a website. It tells the search engine that the old page is outdated and the engine has to index the new page URL.
32. What is the use of Postman Collection runners?
The Postman Collection runner is a powerful tool for Data-driven testing. It allows you to run a group of API requests multiple times, each with different data sets.
33. What are the main limitations of Postman?
Below are some key limitations of Postman:
Postman is unable to handle 1000+ API requests efficiently.
Managing collections and requests becomes challenging in the case of large projects.
Postman is not the ideal tool for managing workspaces in the form of code, as it can lead to code duplication issues, especially with dynamic API requests.
Advanced Postman Interview Questions for Experienced
34. What are the main drawbacks of Postman?
Below are some drawbacks or disadvantages associated with using Postman:
Postman has limitations in processing more than 1000 API requests.
Managing collections and requests for large-scale projects can be challenging with Postman.
Postman may not be the best API tool for workspace management in the form of code, as it can lead to code duplication when handling dynamic API requests.
35. Does Postman provide a feature to log requests and responses?
Yes, Postman provides a feature to log requests and responses. By enabling the Console feature, you can easily view and monitor the details of each request and its corresponding response.
36. What are workspaces in Postman? What are their uses?
Workspaces in Postman are collaborative environments that allow teams to work together efficiently. They provide a centralized space to organize and manage collections, environments, and team members. Workspaces are beneficial for collaboration, version control, and sharing resources among team members.
37. What is an HTTP request? Give an example of an HTTP request.
An HTTP request is a message sent by a client to a server, typically to fetch or modify data. For example, a simple HTTP GET request can be used to retrieve information from a web server, like fetching the content of a webpage:
GET /api/users/123
38. What are the core components of an HTTP request?
The core components of an HTTP request include:
- Request method (GET, POST, PUT, DELETE, etc.)
- Request URL (Uniform Resource Locator)
- Request headers (e.g., Content-Type, Authorization)
- Request body (optional, used in POST or PUT requests)
39. Why does Postman accept Base64 encoding only?
Postman accepts Base64 encoding as it is a widely-used format for encoding binary data into a text string. Base64 encoding is used to handle binary data safely within HTTP requests and responses.
40. Which type of encoding does Postman accept authorization credentials and why?
Postman accepts authorization credentials in Base64 encoding only, which is an inbuilt feature. Alternatively, you can use a third-party website to convert the credentials into Base64. Base64 authorization credentials are commonly used because they convert data into a textual form, making it easier to transmit, such as in HTML form data.
41. What are the core components of an HTTP Response?
The core components of an HTTP Response include:
- Response status code (e.g., 200 for success, 404 for not found)
- Response headers (e.g., Content-Type, Date)
- Response body (contains the data returned by the server)
42. How do you set the same headers for all requests in a Postman Collection?
To set identical headers for all requests in a Postman Collection, you can use pre-request scripts. Follow these steps:
Right-click on the Collection to access the pre-request tab.
Add the lines of code below to the pre-request scripts section to add the desired request header for all requests in the Collection:
pm.request.headers.add({ key: 'TestHeader', value: 'testValue' });
Click Update to save the script.
Run any request within the Collection, and you can check the Postman console to verify that the headers have been added successfully.
Get 100% Hike!
Master Most in Demand Skills Now!
43. How can we access the history of requests in Postman?
You can access the history of requests in Postman by clicking on the History tab in the left panel. This allows you to view and revisit previously sent requests along with their responses.
44. Is it possible to reuse the authentication token for multiple requests?
Yes, Postman allows you to reuse the authentication token for multiple requests. You can extract the token from one response using Postman variables and use it in subsequent requests using variable syntax, like {{token}}.
45. Is it preferable to save our work on Postman Cloud?
Saving work on Postman Cloud is a matter of personal preference and depends on the level of security and privacy required. While Postman Cloud offers the convenience of cloud-based storage and collaboration, some users may prefer to keep sensitive data on local machines.
46. What is the use of Postman Cloud when we are working in a company?
Postman Cloud serves as a centralized platform for team collaboration, version control, and sharing resources within a company. It allows teams to work together efficiently, share collections, and maintain consistency across projects.
47. What is digest auth in Postman?
Digest auth in Postman is a type of HTTP authentication that provides more security than basic authentication. It sends a hashed value of the username and password instead of plaintext credentials.
48. What is the procedure to save the responses of API to a file in Postman?
In Postman, you have two options for saving API responses to a file:
Firstly, you can click on the download button available in the response section.
Alternatively, you can click on the arrow located next to the send button. There, you’ll find an option to send and download. After selecting it, Postman will prompt you to choose the location for saving the response upon successful request execution.
49. What are the standard rules of an API test design?
The standard rules of an API test design include:
- Test the functionality, not the implementation details
- Use meaningful test names and descriptions
- Test both positive and negative scenarios
- Keep the tests independent and isolated
- Make use of assertions to verify expected outcomes
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 the Command or Control button and then clicking on the request.
Postman is a powerful tool that can be used to test, develop, and document APIs. By asking the right Postman interview questions, you can assess a candidate’s skills and knowledge in these areas. The questions that you ask should be tailored to the level of experience of the candidate and the role that they are applying for. However, the basic questions that I have listed in this blog post are a good starting point. By following the tips that I have also listed, you can ask effective Postman interview questions that will help you find the right candidate for your team.