Run collection in Insomnia – Insomnia

by
Ali Hasan
androidtesting django-rest-framework insomnia postman-collection-runner

Quick Fix: To run a collection in Insomnia, first create a document and import the collection. Then, create a test suite in the "Test" tab. Finally, create individual tests for each request you want to run, as Insomnia only allows one request per test.

The Problem:

Sequential Execution of Requests in Insomnia Collection

The Solutions:

Solution 1: Using Test Suites

To run a collection of requests sequentially in Insomnia, you can utilize the Test Suites feature. Here’s how you can achieve this:

  1. Create or Import a Collection: Begin by creating a new collection in Insomnia or importing your existing collection containing the requests you want to execute sequentially.

  2. Create a Test Suite: Navigate to the "Test" tab within Insomnia and click on the "New Test Suite" button. Assign a suitable name to your test suite.

  3. Add Tests: Within your newly created test suite, start adding tests. Each test represents a single request that you want to execute in the collection. To add a test, click on the "+" button and select "New Test Case."

  4. Configure Tests: Configure each test with the appropriate details. This includes selecting the request you want to run, providing any necessary data or parameters, and setting assertions for expected responses.

  5. Arrange Test Order: The order in which you add tests determines the sequential execution of requests. Ensure that the tests are arranged in the desired order of execution.

  6. Run the Test Suite: Once you have added all the necessary tests, you can execute the entire test suite by clicking on the "Run" button. Insomnia will execute the requests sequentially based on the order of the tests in the suite.

  7. Review Results: After the test suite execution is complete, you can review the results to see if all the requests passed or failed. Insomnia provides detailed information about the responses, allowing you to identify any issues or errors.

Q&A

What is the easiest way to execute specific requests in Insomnia?

Create a document, import the collection, open the "Test" tab, and create a test suite.

Does Insomnia support sequential request execution like Postman?

Not natively, but it can be achieved with plugins or external apps.

Can multiple requests be grouped into a single test in Insomnia?

No, each test can only contain one request.

Video Explanation:

The following video, titled "Automated API Testing with Insomnia - YouTube", provides additional insights and in-depth exploration related to the topics discussed in this post.

Play video

This short API Design tutorial shows you how to use Insomnia to test your API. For RESTful API Design, Development, and Testing using ...