+32 3 450 88 42

Automation Thursday

Brightest > Insomnia, not just another API client

Insomnia, not just another API client

Posted by: Koen
Category: Test automation

Nowadays API testing is becoming more and more important. The main reason for this shift to API testing is, off course, the Internet of Things, but also agile development has had a big influence. As agile development is becoming the standard in most organizations, if influences the way we develop software and automate tests. It increased the application’s release frequency, which demands for new ways to receive fast feedback on the quality to these releases. UI tests tend to run horribly slow, are brittle and hard to maintain. So, using these UI tests in continuous builds might not be the most appropriate approach to receive fast feedback. API testing is much faster and more reliable than UI-based tests, thus more appropriate to receive fast feedback.

There are lots of API testing tools available on the market, some of them are free, others require a license. SoapUI, Postman and Rest-Assured are the most popular ones, but there are many other tools, each with their own features and specifications. Insomnia is one of those lesser known API tools. It is a powerful cross-platform REST API client which is very easy to use and has a well thought-out and user-friendly UI. It contains all basic features to test REST API’s like creating HTTP requests with the possibility to add headers and authentication or grabbing the response and view the status, body, headers and cookies. You can structure all you tests by creating a hierarchy of different environments with separated variables which can be easily referenced by autocompletion anywhere within the tool. Other nice features are the template tags (which are more like operations you can call, e.g. generating timestamps, transforming strings, …), request-chaining, response history, code snippet generation in 12 different languages, working with proxies, JSON filtering on the responses, and many more … . All these features are offered in a free version, but there’s also a licensed version with more functionalities when working in teams.

Compared to Insomnia, Postman is a more mature tool and has a much bigger community. Postman focuses more on having almost every possible feature into their tool, whereas Insomnia focuses more on just being an HTTP client with some additional features to be able to work more productive. This results in Insomnia being suitable for not as many cases as Postman, but instead it gives you a better user experience. Even though Postman is suitable in almost any case, there are some situations where Postman might not be the best match as an API testing tool e.g. Postman sometimes has difficulties when working with a custom proxy, while Insomnia works great in these kind of situations. For most use cases, Insomnia’s core features should be sufficient. However, if more advanced behavior is required, it offers the possibility to create your own plugins to extend the functionalities.

Overall, Postman is one of the leading API testing tools, it’s more mature and contains more features compared to Insomnia. Features like the test collection runner, real-time documentation generation, the ability to mock API’s, … are big selling points. Both tools have their advantages, so why not work with both of them? You can easily export your API requests from Postman and import them in Insomnia, or you can use Insomnia’s ability to paste cURL code from Postman in order to recreate your Postman request within Insomnia. This way you can use the best of both worlds…

For those who are interested to explore Insomnia, you can download it on their website. If you want to start working with Insomnia you can check out their online documentation.