Postman and API Testing Tutorial
Learn Postman and API Testing step by step: 30 lessons in 7 chapters with examples, quizzes, diagrams and projects.
Start learning →
of lessons completed
Getting Started
- What is API testing? Learn what API testing is, how it differs from UI testing, where it sits in the test pyramid, what to check in a response, and where Postman fits in.
- Types of APIs and API testing tools compared Learn the API styles (REST, SOAP, GraphQL, gRPC), the public, partner, private and composite access models, common restrictions, and how Postman compares with other testing tools.
- HTTP and REST in ten minutes Learn the HTTP basics every API tester needs: requests, methods, status codes, headers, bodies, idempotency and REST resources, with runnable examples.
- Installing Postman and a tour of the interface Install Postman, choose between the desktop and web app, and learn the workspace, sidebar, tabs, request builder, response viewer and console.
Sending Requests
- Your first request Send your first GET request in Postman: type the URL, add query params, press Send, then read the status, time, size and the Pretty, Raw and Preview views.
- Methods and request bodies Use GET, POST, PUT, PATCH and DELETE in Postman, and choose the right body type: raw JSON, form-data, x-www-form-urlencoded, binary or GraphQL.
- Query params, headers and cookies Master Postman's Params and Headers tabs: query and path variables, automatic and custom headers, content negotiation with Accept, and the cookie jar.
- Authentication: API keys, Basic, Bearer and OAuth 2.0 Learn how the Postman Authorization tab sends API keys, Basic credentials, bearer tokens and OAuth 2.0 tokens, how inheritance works, and how to read a JWT.
Organizing Work
- Collections, folders and requests Learn how Postman collections, folders and requests fit together, how auth and scripts are inherited, naming and documentation habits, and the collection JSON format.
- Environments and variables Understand Postman variable scopes, how {{variable}} names are resolved, initial versus current values, environments for dev and prod, and how to keep secrets safe.
- Dynamic variables and generated test data Learn every family of Postman dynamic variables, how to use them in bodies and scripts, how to keep a generated value for later requests, and how to make test data repeatable.
- Saved examples, documentation and mock servers Save responses as Postman examples, publish generated API documentation, import OpenAPI files and run a mock server from examples. Includes a runnable mock stand-in.
Writing Tests and Scripts
- Pre-request scripts Write Postman pre-request scripts with the pm API: set variables, add timestamps and dynamic data, sign requests with HMAC, and use the built-in libraries.
- Writing tests with pm.test and Chai Write Postman tests with pm.test and pm.expect: check status codes, JSON bodies, headers and response time, validate a JSON schema, and read the Test Results tab.
- Chaining requests and workflows Learn to chain Postman requests: save tokens and ids from responses, reuse them in later requests, control order with setNextRequest and clean up.
Running at Scale
- The Collection Runner and data-driven testing Run a whole Postman collection at once, repeat it with CSV or JSON data files, read the results, and learn data-driven testing with a Python stand-in.
- Newman, the CLI and CI/CD Run Postman collections from the command line with Newman, pick reporters, read exit codes, and wire the run into GitHub Actions or GitLab CI.
- Monitors, performance and load basics Schedule Postman monitors, set response-time budgets, read percentiles instead of averages, and learn what simple load tests can and cannot tell you.
Advanced API Testing
- API testing strategy and test design Design better API tests: positive, negative and boundary cases, a status-code matrix, validation errors, idempotency, pagination, flaky tests and what to skip.
- Software testing types and design techniques for APIs Understand unit, integration, system and acceptance testing, functional versus non-functional tests, black, white and gray box, and design API cases with boundary values and decision tables.
- Security testing basics for APIs Learn API security testing basics: the OWASP API Top 10, broken object-level authorization, auth failures, injection, rate limits and mass assignment.
- Contract testing and OpenAPI Learn how OpenAPI and JSON Schema describe an API contract, how to validate responses in Postman, spot breaking changes and use consumer-driven contracts.
- Testing GraphQL, WebSocket and gRPC Learn how GraphQL, WebSocket and gRPC differ from REST, how to send each kind of request in Postman, and how to test their unusual success and error rules.
- Postman Flows, collaboration and AI features Tour Postman Flows, workspaces, forks and pull requests, the API Network and the Postbot AI assistant, and learn how to use each one safely and sensibly.
Projects and Practice
- Project: test suite for a CRUD API Build a complete test suite for a to-do CRUD API: environments, bearer auth, chained create-read-update-delete tests, negative cases and clean-up.
- Project: testing a login and token-refresh flow Test the full token lifecycle: login, short-lived access tokens, expiry, a refresh script in Postman, token rotation and the negative auth tests that matter.
- Project: automated regression in CI Put a Postman collection in a repository, run it with Newman in a GitHub Actions pipeline, publish JUnit reports, fail builds on regressions and schedule nightly runs.
- Practice exercises with solutions Eight hands-on Postman and API testing exercises on assertions, variables, chaining, negative tests and data-driven runs, each with a worked solution.
- Postman and API testing interview questions Prepare for Postman and API testing interviews: concepts, scripting, variables, CI and strategy questions with clear answers and runnable examples.
- Postman and API testing cheat sheet A one-page Postman and API testing cheat sheet: pm.* snippets, status codes, variable scopes, Newman flags, shortcuts and a test checklist.