api testing

API Testing: All about SoapUI and Postman

What is API testing

API testing is a software testing practice that allow us to validate the services behind the applications.

When API testing is performed, we test the services without the UI layer on top of them, this allows us to perform detailed test, sending queries to the services and validating the responses directly.

How to test an API

There are several tools in the market that can perform API testing, some of them are JMeter, SoapUI, Hoppscotch, Insomnia and Postman.

The approach is always the same, we have a collection of queries that we execute and then we validate the responses from the tools.

Having the collection mentioned above, we can execute different types of tests, for example, functional tests validations by just executing the queries one by one of load, performance and stress validations by executing many of the queries in parallel for a long period of time.

SoapUI

What is SoapUI

SoapUI is an functional testing open source tool designed for testing REST, SOAP, and GraphQL APIs. With SoapUI you can create automated functional, regression, and load tests for all your APIs.

How to use SoapUI

If you want to start working with SoapUI you just need to download the open source version of SoapUI from their official website.

Once you download and install the tool you will see the initial screen upon opening it:

On this screen we have the projects on the left side of the application, from there we can create a new Rest, Soap or empty project.

Let’s create a new Rest project:

As you can see now we have a window where we can start querying the endpoint, for this example I will use this blog to search something, let’s add parameters to the query:

After we added the parameters we just click the green arrow to execute the query and see the results in the window on the left.

As we can see we searched for “automation” in relevantcodes.com and we see the result from the site in HTML, Json, XML and Raw formats.

What is Postman

Postman is a tool that allows us to test any API using a friendly interface. The tool allows us to create complete API test collections which can be executed locally or in a CI/CD environment.

If you want to use the tool you can download it from the official postman site.

How to use Postman

Once you open postman, you will see the following screen:

On this screen you will see many options, it seems complex but it’s very simple. Let’s do the same that we did on the above example with Postman.

First of all, let’s click on the + icon on the top of the screen, you will see this:

Now we can create our query, let’s search for “automation” on this website:

As you can see, we can just add the keys and values for each one of the parameters and Postman will do the rest.

Hoppscotch

What is hoppscotch

Hoppscotch is an open source API testing tool, similar to Postman, that allows us to perform functional API validations using a web interface. Registration is not required but it is recommended if you want to save the results and collections.

How to use hoppscotch

Using hoppscotch is easy, as it’s interface is very similar to Postman. Let’s do the same test that we did with the other tools to compare.

Once you open the application, you will see the following screen:

On that screen we can configure our test script:

As you can see, we are going to send a request to this site for a search of “automation”, once we send the request by pressing the send button, we will see the result data on the screen.

Hoppscotch is a great open source alternative with tons of features that you can use to test your applications.

Insomnia

What is Insomnia

Insomnia is a commercial tool that also allows us to create and execute API validations. It supports plugins and can be used on CI/CD.

How to use Insomnia

The first thing that we need to do is to download insomnia from their website and download the free version.

After we download and install the tool, we open it and we have the following screen:

After we open the app, we just have to complete the query parameters as we did before:

After we complete the parameters, we just have to send the request and voila!

As you can see, all the tools works in a similar way, once you are familiar with one you can almost use any of them.

What are the differences between Postman and SoapUI?

Both tools are able to do almost the same, as they are both API testing tools, but, they have some different aspect that you might want to consider before choosing the one that is better for you:

  1. User interface: Postman has a user-friendly graphical interface, while SoapUI has a more technical interface, suitable for advanced users.
  2. Functionality: SoapUI provides a more comprehensive range of functionalities, including functional testing, load testing, and security testing. Postman is primarily used for API testing and does not have as many advanced features as SoapUI.
  3. Ease of use: Postman is easier to use and requires less technical knowledge than SoapUI.
  4. Collaboration: Postman provides features for collaboration and sharing of API collections, while SoapUI does not.
  5. Integrations: Postman integrates with popular development tools like GitHub, while SoapUI supports integration with various tools and services like JIRA and Jenkins.

In summary, SoapUI is a more powerful and comprehensive API testing tool, while Postman is easier to use and provides better collaboration features.

The choice between them will depend on the specific requirements of your API testing project.

How to Get Started with API Testing?

API testing is a critical part of software development, and it is important to have a good understanding of the process to ensure that your APIs are working as expected.

My recommendation if you want to start testing your APIs is to start with the following:

Familiarize yourself with the API specification: Read the API specification, including the request and response formats, endpoints, and authentication requirements.

Choose an API testing tool: Select a tool that fits your requirements, such as Postman or SoapUI, and install it.

Write test cases: Define the test cases for your APIs, including the inputs, expected outputs, and any error conditions.

Execute the tests: Run the tests using the API testing tool and examine the results.

Document the results: Document the results of the tests, including any bugs or issues found and the steps taken to resolve them.

Challenges of API testing

Effective API testing requires careful planning, attention to detail, and a thorough understanding of the APIs and their dependencies.

Addressing these challenges will help to ensure that your APIs are tested thoroughly and that any issues are identified and resolved promptly:

  1. Complexity: APIs can be complex, with multiple endpoints and parameters, making it difficult to test all possible combinations and scenarios.
  2. Security: APIs may contain sensitive information, such as personal or financial data, and it is important to ensure that they are secure and protected against attacks.
  3. Documentation: Poor or outdated API documentation can make it difficult to understand how to test the API and what the expected outcomes are.
  4. Dependency on external services: APIs may depend on external services or data sources, which can affect the reliability and accuracy of the test results.
  5. Data management: APIs may handle large amounts of data, making it challenging to manage and test all the data required for the tests.
  6. Performance: APIs must be tested for performance, including response time and capacity, to ensure that they can handle the expected load and traffic.
  7. Continuous integration and deployment: With the increasing use of continuous integration and deployment, it is important to have a testing process that can be integrated into the development workflow.
  8. Maintenance: APIs can change over time, requiring updates to the test cases and test data to reflect the changes.

Conclusions

There are many different tools for API testing in the market, choosing one might be a challenge because most of them have the basic features covered, and we have free, open source and paid tools.

The main differences are in team support, cloud saving, tech support, community, licensing and cost, so if you are a freelancer any of the open source options will be good for you, but if you work with big teams, you might want to consider a commercial licence.

4 thoughts on “API Testing: All about SoapUI and Postman”

  1. Pingback: API in software testing

  2. Pingback: Pokemon api for testing

  3. Pingback: Negative testing in software testing

  4. Pingback: All about your software testing career

Leave a Comment

Scroll to Top