Answer
What is Postman?
Postman is a popular API platform used for building, testing, and documenting APIs. It provides an intuitive GUI (Graphical User Interface) that allows testers and developers to:
- ✓Send HTTP requests (GET, POST, PUT, PATCH, DELETE)
- ✓Inspect responses (status codes, headers, body)
- ✓Write test scripts to automate API validation
- ✓Organize requests into collections
- ✓Share API workflows with teams
Why is Postman Used in API Testing?
1. Easy to Use
No coding knowledge required to send basic requests — just enter the URL, select the method, and click Send.
2. Request Builder
- ✓Supports all HTTP methods
- ✓Easy setup of headers, params, body, and auth
- ✓Supports JSON, XML, form-data, raw text
3. Response Inspection
- ✓See status code, response time, response size
- ✓Formatted JSON/XML view for easy reading
- ✓Headers tab for response headers
4. Test Scripts
Write JavaScript-based tests to automate assertions:
pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});
5. Collections
Group related API requests into reusable collections and share with your team.
6. Environment Variables
Switch between dev/staging/production easily using environment variables.
7. Newman (CLI)
Run Postman collections from the command line for CI/CD integration.
Postman vs REST Assured
| Feature | Postman | REST Assured |
|---|---|---|
| Language | JavaScript (tests) | Java |
| UI | Yes (GUI) | No (code only) |
| Learning curve | Low | Medium |
| CI/CD integration | Via Newman | Direct JUnit/TestNG |
| Collaboration | Built-in sharing | Version control |
