soapui api automation - test suite

In this blog series, I will help you become an accomplished API automation engineer. Last post we created more Resources and Requests in the SoapUI application. Part 5 is about creating a Test Suite for your SoapUI project.

If you don’t have SoapUI you can download it here.
View all posts from the series here.

Web Hosting

Create the Test Suite

Creating the Test Suite is easy.

  1. Right-click on the “PokeApi.co” service.
  2. Click on “Generate TestSuite”. You will see a window that looks like this.

Generate TestSuite

  1. Click Ok
  2. The default Test Suite name is fine, so click OK.

You have now created a TestSuite that should look like this:

Test Suite

We are going to ignore the “Load Test” and “Security Test” items in here for this tutorial. The TestSuite is divided into three parts.

Test Suite: Think of this as a folder for the test cases.
Test Case: The Test Case is what you are trying to test.
Test Step: The Test Step is the individual steps that are required to execute the test case.

Think of the structure in this way… A Test Suite has many Test Cases. Each Test Case has many Test Steps.

Rename all three test cases by putting “Get All” in front of the Test Case name. These will serve as the default test cases. Remember from the API documentation that if you don’t pass a parameter value, everything will be returned. Your Test Cases should now look like this:

Test Suite

Create more test cases

We are going to use the three test cases that we have created as templates for making all future test cases.

  1. Right-click on the “Get All Resource List TestCase”.
  2. Click the “Clone Test Case” option
  3. Give it the name “Get berry Resource TestCase” and click OK
  4. Rename the Test Step to “Get berry Resource”
  5. Open the Test Step and give it a parameter value of “berry”

If you followed along, your test case should look like this:

Berry Test Case

Let’s create a second Test Case for the Item resource.

  1. Right-click on the “Get All Item TestCase”.
  2. Click the “Clone Test Case” option
  3. Give it the name “Get item id 1 TestCase” and click OK
  4. Rename the Test Step to “Get item id 1”
  5. Open the Test Step and give it a parameter value of “1”

Your Test Case should look like this:

Item 1 Test Case

Now you try and create a new Test Case for the Pokemon resource. Choose something to test from the API documentation. Don’t forget to set the value.

Great work! You have successfully created a Test Suite and several Test Cases. Next time we are going to work on Assertions.

Next: Assertions

 


0 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.