Run collections in the Postman VS Code extension
The Postman VS Code extension serves as a developer’s indispensable ally, seamlessly integrating the robust capabilities of the Postman API Platform directly into the VS Code environment. By bringing advanced features like the Postman Console, documentation, and dynamic variable support into the code editor, it empowers developers to efficiently design, test, and collaborate on APIs with unparalleled ease and speed.
API development just got a power boost with the latest feature added to the Postman VS Code extension—the Collection Runner. The Collection Runner enables you to run a collection’s requests in a specified sequence to test the functionality of your API. It logs your request test results and can use scripts to pass data between requests and alter the request workflow.
Configuring a collection run
Users can configure the requests in a collection or a folder by clicking on the Run button in the collection or folder Overview tab. To run requests in a collection or folder, follow these steps: first, select Collections in the sidebar and choose the desired collection or folder, and select Run.
Users can associate their collection with an environment, selecting it using the environment selector at the top right or from the sidebar. Various configuration options are available, including setting the number of iterations, specifying delay intervals between requests, persist responses for a session, and other advanced settings.
The sequence of request execution can be modified by dragging requests. After configuring your settings, select Run with the collection or folder name.
Debugging run results
During manual collection runs in the Postman VS Code extension, real-time results of request executions and test outcomes are provided, showing details such as the source of the collection run, selected environment, number of iterations, total duration, etc.
In the Collection Runner results, users can explore the run further by selecting a specific request to view comprehensive information about the request, including headers and body. Filtering options are available via Passed, Failed, or Skipped tabs, with the All Tests tab showing all requests. Users can navigate through results for specific iterations, access a list of past runs, and return to the full results as needed.
Viewing run history
Each collection has a Runs tab you can use to view past runs, scheduled runs, and performance runs. You can also view details such as test counts and average response times. The Runs tab has controls to select how many collection runs to view, and limit the displayed runs to those from selected users, of a selected status, and either from the Collection Runner or the Postman CLI.
The Collection Runner in the Postman VS Code extension helps in streamline their API testing workflow. With iterative execution, insightful reporting, and seamless environment integration, it’s a tool designed to enhance efficiency and accuracy in every testing cycle.
If you haven’t already tried it out yet, you can install the Postman VS Code extension from the VS Code marketplace.