DevNet Associate (DEVASC) v1.0Understanding and Using APIsHard
A developer is performing API testing using Postman. They have successfully created a collection of requests to a Cisco API and want to automate the execution of these requests in a specific order, including handling environment variables and testing assertions for each response. Which Postman feature is designed for this exact purpose?
- APostman Monitors
- BPostman Mock Servers
- CPostman Collection Runner
- DPostman Workspaces
Show answer & explanationAnswer & explanation
Correct answer: C. Postman Collection Runner
The Postman Collection Runner is specifically designed to run requests in a collection sequentially or iteratively. It allows for the use of environment variables, data files, and pre-request/test scripts to automate workflows, validate responses with assertions, and generate reports.
Why the other options are wrong
- A. Monitors schedule collection runs at intervals from Postman's cloud to check API performance and uptime, but the Collection Runner is used for the actual execution.
- B. Mock Servers simulate API responses, useful for development when the actual API is not ready, not for running existing requests.
- D. Workspaces are for organizing collections, environments, and other Postman elements, not for executing tests.
Postman Collection Runner
The Postman Collection Runner is a feature that allows users to automate the execution of all requests within a Postman Collection. It supports iterating through requests, using environment variables, and executing pre-request scripts and test scripts for automated testing.
- Automates sequential execution of requests in a collection.
- Supports iteration over data files.
- Executes pre-request and test scripts.
- Manages environment variables during the run.
- Generates a summary report of test results.
Memory trick: Collection Runner Runs Tests, Monitors Watch, Mocks Fake.