Blog

Insomnia API Testing vs Postman vs SoapUI

Explore Insomnia API testing and learn about its main features. We will compare Insomnia vs Postman vs SoapUI, highlighting the distinct advantages Insomnia offers for developers and software engineers, especially in terms of developer productivity, API lifecycle management, and test automation.

Insomnia

As software development continues to advance at a breakneck pace, the ability to efficiently test APIs across different platforms becomes crucial for enabling the robustness and reliability of applications.

Insomnia API testing stands out as a powerful tool in this domain, offering an array of features designed to streamline the API lifecycle and enhance test automation.

Through this article, we delve into the capabilities of Insomnia, shedding light on its comparison with other giants in the field such as Postman and SoapUI. We underscore the significance of environment variables, API calls, and HTTP requests in crafting seamless testing experiences for software engineers and developers alike.

Take a look at our case studies to see how our test automation services are helping grow businesses worldwide.

What is the Insomnia API Testing Tool?

First and foremost, before we make our comparison between tools, let’s start with the basics and answer some questions about this topic.

What is Insomnia in testing?

In the context of software testing, Insomnia refers to an open-source API client that simplifies the process of sending HTTP requests and analyzing responses. It is used by developers and testers to validate API endpoints, test the functionality of REST and GraphQL APIs, and ensure that APIs meet their design specifications.

Is Insomnia the same as Postman?

While Insomnia and Postman are both API clients used for designing, testing, and managing APIs, they are not the same. Each tool has unique features and user interfaces. Insomnia is known for its simplicity and streamlined interface, while Postman offers extensive documentation and collaboration features. The choice between Insomnia and Postman often comes down to personal preference and specific project requirements.

Is Insomnia a free API?

Yes, Insomnia is a free, cross-platform desktop application that simplifies the interaction and design of HTTP-based APIs. This tool combines an easy-to-use interface with advanced features like authentication wizards, code generation, and environment variables.

It serves as a scratch pad for developers, making it easier to test and refine APIs. It positions itself as a cornerstone for Insomnia users in managing REST APIs and HTTP requests with efficiency and precision.

There is also a paid version, Insomnia Plus, which includes additional features like team collaboration and advanced data syncing capabilities.

Authentication wizards, code generation, and environment variables

Insomnia vs Postman vs SoapUI

When building quality software, understanding the API design and choosing the right cross-platform API client is pivotal. This analysis compares the main features of Insomnia with Postman and SoapUI, focusing on test automation, API testing, and developer productivity.

The Postman team has developed a tool that’s widely used in the industry, but Insomnia offers a compelling alternative with features that promote efficiency and ease of use, especially for those looking to create organizations and manage their APIs in a streamlined environment.

While Postman is celebrated for its comprehensive testing capabilities and user-friendly interface, SoapUI is often preferred for more complex SOAP-based services due to its robust testing features and ability to handle advanced API testing scenarios. SoapUI allows detailed assertions and data-driven testing, which can be crucial for enterprise environments that require rigorous testing protocols.

Comparatively, Insomnia shines with its minimalist design and effectiveness in handling both REST and GraphQL APIs, making it a favorite for developers who appreciate a streamlined workflow and powerful features without the complexity of SoapUI or the breadth of Postman’s features.

TABLA (No logro que Surfer me deje pegar tablas, acá iría la tabla que está en la web en este espacio)

A First Approach to Insomnia API Testing

Let’s get to understand what features Insomnia has as well as to know first-hand how it handles both REST and SOAP APIs. With this aim, we carried out these tests against the APIs GoREST and CountryInfoService.

Following the style of the article “Hoppscotch: Open Source API Development Ecosystem”, we want to dive into how Insomnia behaves by testing a Rest API versus Postman and a Soap API versus SoapUI.

We will share some screenshots taken during the tests to show what the tool looks like. After downloading and installing it, its use is really intuitive since it presents an interface very similar to Postman.

Proof of Concept: GoREST

GoRest is a Rest API that is available online for testing and prototyping. It allows the registration of users who can publish posts and comments. As this is a testing API it only contains fake data.

To start testing GoREST, create a project in the Insomnia dashboard:

Insomnia deshboard
Insomnia deshboard 2

Acá en la web hay dos imágenes más pero creo que están repetidas, verificar por las dudas por favor

Being able to manage environments is crucial. That’s why the first thing we did was configure the work environment. To do this, go to the environments menu and select the Manage Environments or Ctrl+E option:

Manage Environments

In the environment manager, we display the options in Sub Environments and select Environment:

Sub Environments - Environments

With the new environment created, we can click on the name to edit it and start writing the parameters in JSON format:

JSON format

Once the environment is created, we must select it from the drop-down list:

Poc GoREST

Within the environment, create the collections to organize and store the different requests:

Different requests

Unlike Postman or SoapUI, collections or folders are not exported directly from the context menu. However, in Settings, you can move or copy them to another Workspace.

Move or copy to worspace

To import or export any document or collection from the workspace, go to the menu that is displayed in its name and select Import/Export:

Import or export

As in similar tools, you can use parameters in requests through environment variables, defined in JSON format.

To invoke any parameter, press Ctrl+Space where you want to insert it, and it will display a list with all the available variables.

Variables
Base Environments

It is also possible to indicate the parameter directly in the Query section of the request:

In the case of sending a POST type request, as in other tools, you can select the type of Body (JSON, XML, YAML, EDN, Plain, Binary File, No Body):

Body

In the case of the API you are testing, it is necessary to send an authorization token. You can add it to the Auth section by selecting the type of authorization required:

Select the type of authorization required

Insomnia allows you to make requests from cURL. To do this, copy one of the cURLs offered by the GoRest API as an example and paste it into the request URL:

Request URLS

Likewise, it is possible to send attached files if you select Binary File in the Body:

Binary file

After selecting the file, the request will look like this:

Request

You can see the result on the right side of the screen as follows:

Result

Another feature shared with other tools is the response history on the right to be able to trace our work:

Response history

Proof of Concept: CountryInfoService

It is a web service that displays country information from a two-letter ISO code, for example, “UY”. It offers functions to recover the currency used, the language, the capital city, the continent, and the telephone code.

To get started, we created another project in the Insomnia dashboard. We also configured the environment and collections of the new Project:

New project
PoC CountryInfoService

For requests of the SOAP type, select XML as the Body type and give it the corresponding format (XML):

XML

An important thing: you must select the POST method, although it is possible to use GET in Soap web services, typically, given that this protocol uses verbose payloads, POST is usually used. In addition, it is also necessary to configure the headers:

Configure the headers

And you get the answer:

Answer

If you prefer to pass data as parameters in the request, you can do it as follows:

Pass data as parameters in the request

Chaining Requests

Insomnia allows the extraction of values ​​from the answers to be used in other requests. For example, using the response ID of a POST method in a GET request. You can see this Documentation for more information.

There are three types of response options:

Response – Body Attribute:

Works on JSON and XML responses, pulling attributes from a response body.

Response – Raw Body:

References the entire body contents of a request.

Response – Header: 

Pulls specific header values out of a response.

For example, in the empty URL bar, enter ‘/response’ to specify the data you want to obtain, and the options will be displayed.

URL Bar

Select the desired one. In our case, we selected Body Attribute.

Then click on the red tag and configure the rest of the options.

Body Attribute

In Request, specify which request you are referring to. Select it from the drop-down list. In Filter, which can be a JSONPath or XPath, enter the data that you want to obtain from the response, which will be displayed in the Live Preview box.

Live Preview

In the following example in the GoRest project, use the id obtained from the POST NewUser method response to send a GET UserById request. Pass the data as a request query:

GET User ById request

And configure the tag as follows:

Tag

In the following example in the CountryInfoService project, take the ISO Code from the response of the CountryByName request and pass it to the FullCountryInfoByISOCode request as follows:

ISO Code

As in the previous case, we select the response that contains the data, and in Filter we enter the corresponding XPath:

In this way, you can see that it is different from how data is handled between requests in Postman for example, although Insomnia also allows you to do it through environment variables.

Testing With Insomnia

Unlike Postman or SoapUI, Insomnia API testing offers a separate tab for testing. Previously we were working on the DEBUG tab with the requests and responses. Unit tests are based on the Mocha and Chai framework for assertions, with JavaScript, according to the documentation.

Post Test Suite

You can organize unit tests in Suites, and run them individually. You also can run the complete Suite.

Example
Image 1

Image 1 shows the organization of unit tests in Suites in the left panel.

Image 2

This second image shows the unit tests within the Suite, related to the corresponding request, in the central panel.

Image 3

And image 3 shows the results of the tests with the time consumed, in the panel located to the right of the workspace.

In the case of the project with SOAP it is the same procedure:

SOAP Test Suite

Inso CLI

Inso CLI (Command Line Interface) for Insomnia is based on Node.js and the core Insomnia libraries. It allows you to use Insomnia functionality in terminal and CI/CD environments for automation. At this time, Inso CLI only works with design documents and does not request collections.

There are two ways to install Inso CLI:

  • From an executable that is downloaded from GitHub 
  • Through NPM insomnia-inso (Node.js 16.x LTS)

Inso Run Test

In our case, we installed it using the first option. After installed, we tried with the commands as explained in the documentation, and this was the result of running the test suites of the GoREST project:

Result

When running the inso run test command without specifying a document, we are prompted to select one from the list. After selecting the document or suite to test, we are asked to select the environment, as shown in the screenshot.

We did the same for the CountryInfoService project:

CountryInfoService

If a report type (dot, list, spec, min, and progress) is not specified, spec is used by default.

Inso Export Spec

This command extracts and exports the raw OpenAPI specification. The OpenAPI specification is the standard for documenting APIs, and OpenAPI 3.0 is the latest version. OpenAPI 3.0 offers several improvements, such as a simpler structure for defining APIs and more reusable components to reduce duplication.

With the –output <path> option, the specification is saved to a file.

Export the specification loaded in the ‘DESIGN’ tab.

An OpenAPI document describes the public interface of the REST API and defines information such as name and description, the individual endpoints (paths), and how issuers are authenticated. One of the main benefits of using OpenAPI is for documentation; once you have an OpenAPI document that describes your API, it’s easy to generate reference documentation for it.

Inso Generate Config

This command generates a configuration from the API specification declared in DESIGN using openapi-2-kong. The command works similarly to generating a declarative configuration file or Kubernetes manifest from Insomnia. An example can be seen here.

Insomnia allows you to create a preformatted decK file when adding endpoints to the document, or you can take a document and generate a Kubernetes manifest.

Both options are also available in the Insomnia user interface.

Continuous Integration and Collaboration

Insomnia shines in collaboration, offering features that enhance project management and team synchronization. Its enterprise plan includes enterprise SSO, making it a preferred choice for organizations prioritizing security and collaboration.

Integration

Inso CLI is designed to run in a continuous integration (CI) environment, removes the need to interact with the tools through prompts and provides exit codes to pass or fail the CI workflow. An example can be seen here.

Collaboration

To work as a team and to be able to synchronize projects, it is necessary to register in the Insomnia web dashboard. The documentation explains how to work as a team and synchronize projects.

Manage your Insomnia API testing account

Once entered into the dashboard, you can manage the team and add members via email.

Manage teams

Once the work is synchronized, all team members can view the shared dashboard projects on Insomnia API testing desktop.

Our dashboard:

Dashboard

A collaborator’s dashboard:

A colaborator dashboard

Pros

  • Its paid version is the cheapest compared to Postman or SoapUI (see Pricing table).
  •  It allows you to manage the Cookies of the responses and send them in the requests automatically when necessary.
  • It allows integration with GitHub in a simple way.
  • It allows the handling of variables and data in a simpler way than alternative tools.
  • It allows you to generate code snippets for more than 12 different languages ​​from the requests.
  • It also allows you to import an API swagger in the DESIGN tab from a yaml file or by manually entering the appropriate format.
Generative code image 1
Generative code image 2
Design
Swagger Petstore

Cons

  • Environment variables can only be set in JSON format.
  • The test scripts must be entered manually since it does not present snippets like Postman for example.
  • Collaboration and teamwork are only available in the paid version.
  • There’s Little documentation about requests for SOAP.
  • Inso CLI does not work with collections.
  • It’s only available for Desktop in English.
  • Although it presents a dashboard on the web for teamwork management, requests and responses can only be managed from the desktop version.

Final Thoughts

In comparing Insomnia vs Postman vs SoapUI, Insomnia emerges as a tool that presents many advantages in API testing and developer productivity. Whether you’re an experienced software engineer or new to the field of API testing, Insomnia offers a robust set of features designed to improve your workflow and testing capabilities.

Although Insomnia has an interface very similar to Postman, as the work area is divided into 3 ‘tabs’ where different topics are dealt with (DESIGN/DEBUG/TEST), it makes it a more organized tool to work with.

The dashboard that it presents with the different workspace projects and other actions such as creating the documentation, are also user-friendly and help keep our projects organized.

It has very similar features to Postman, but not so to SoapUI. Compared to Postman, we found it to be a very versatile tool when working with data and variables. In the testing section, it would be better if some snippets were added to help.

Inso CLI allows an approach to test automation allowing to run the suites, although, in our opinion, it would be better to be able to run the collections.

Finally, the integration with GitHub seems to be a plus to highlight since nowadays collaborative work on the network is essential.

If you find Insomnia API testing interesting, we invite you to use it and leave me your comments about it.

We are quality partners! Learn more about our solutions, and contact us to discuss how we can help you grow your business.

Abstracta Ilustration

Follow us on Linkedin & X to be part of our community!

429 / 437