Your First REST Test

This guide describes how to create your first REST projects in SoapUI. SoapUI projects are the central point in all SoapUI testing. Once you create the project, you can expand it with functional tests, load tests, mock services, and much more. This tutorial uses the sample Petstore web service located at http://petstore.swagger.io/v2/swagger.json to describe the two main steps of creating a REST project. 

The REST testing bases around sending different requests to a RESTful API and verifying responses from it. This tutorial describes the basic ways of creating REST projects in SoapUI:

  • Create REST project from Endpoint
  • Create REST project from Definition

Create REST Project From Endpoint

  • In the Navigator, right-click Projects and select New REST Project.

    The New REST Project menu item

    The New REST Project dialog will appear.

    Note: To create a new REST project, you can also press CTRL+ALT+N (in Windows) or CMD+ALT+N (in OS X).

  • In the dialog, specify the URI path to your REST API in the URI edit box.

  • Click OK

Screen-Shot-2018-08-22-at-4-43-53-PM.png

 

Now you're presented with our main screen for REST projects. Click the Green Play Button in the top left and you'll see the API's response.

 

Screen-Shot-2018-08-22-at-4-44-27-PM.png

 

We can now visually explore our API and it's responses. But to create an assertion, we'll first have to create a Test Case.

In the left-hand Navigator window, right click "Request 1" and then click "Add Test Case".

 

Screen-Shot-2018-08-22-at-4-44-53-PM.png

 

Now we see the our Test Case window, where we can create assertions. We'll need to click the Green Play Button again to see our response.

 

Screen-Shot-2018-08-22-at-4-46-35-PM.png

 

To create our first assertion, select the Assertion tab in the bottom left and click the Green Plus Sign

 

Screen-Shot-2018-08-22-at-4-46-57-PM.png

 

You can click Content, and we'll verify that "Petstore" is present.

 

Screen-Shot-2018-08-22-at-4-47-12-PM.png

 

The new project we've made will appear in the Navigator, along with the web service operations available for the REST API in question. You can then double-click the name of the project to get a project overview:

The REST project overview

Double-click the name of the service to get the service overview:

The REST service overview

 

Next Steps

Check out SoapUI 101, our comprehensive beginner's guide to API testing! It's loaded with step-by-step tutorials for getting with SoapUI and SoapUI Pro: Read the Guide