Applies to ReadyAPI 2.5, last modified on October 22, 2018

Requirements

To test a SOAP service in ReadyAPI, you need a WSDL definition of this service. This definition describes operations of the service, and the format of requests and responses. ReadyAPI uses this information to simulate requests.

REST services can also have definitions. Most frequently-used definition formats are OpenAPI (formerly known as Swagger), WADL, and some others. You can load these definitions in ReadyAPI and create test cases based on information in these definitions.

In a general case, a REST service may have no definition at all. You can create tests for such services in ReadyAPI by recording requests to service URLs (this is called API Discovery). ReadyAPI will get information on request and response parameters based on the tracked traffic. However, this “observational” data is not as precise as information from a definition, so, we recommend using definitions when it is possible.

Web Service Definition We Will Use

We will create a test for the Petstore sample web service. This is a REST service. You can find its definition here –

http://petstore.swagger.io/v2/swagger.json

This definition has an OpenAPI 2.0 (Swagger) format. No need to download the definition now. ReadyAPI will do this later when we create a functional test. See below.

Create a Test

  1. Switch to the SoapUI start page and click Create a test from an API Definition:

    Functional testing with ReadyAPI: Create a functional test

    Click the image to enlarge it.

  2. In the subsequent wizard, specify the URL of your web service’s definition. In our case, it is http://petstore.swagger.io/v2/swagger.json:

    Creating API functional tests in SoapUI: Enter web service definition

    Click the image to enlarge it.

    Click Next to continue.

  3. Select if you want to create a new project for the definition you have added, or add it to the existing project.

    Creating API functional tests in SoapUI: Specify project

    Click the image to enlarge it.

    Note: If no projects are open in your workspace, the wizard will skip this step. In this case, ReadyAPI will create a new project and add the new test to it.

    Click Next to continue.

  4. On this page of the wizard, you can select assertions to be added to the test. ReadyAPI adds the selected assertions to new test requests.

    Assertions verify that your API works as expected. Later in this tutorial, we will describe them in more detail, but now, clear the selection and click Next.

    Creating API functional tests in SoapUI: The Add assertions page

    Click the image to enlarge it.

  5. Select if you want to have one test case for all operations defined for your web service, or use multiple test cases (one per each operation). Let’s use the latter option:

    Creating API functional tests in SoapUI: Select test cases

    Click the image to enlarge it.

    Click Finish to create a test.

  6. ReadyAPI will create a test project and add test cases to it.

    After that it will display one more dialog box, where you can run the created tests or add a data source to them. In this tutorial, we will not use these options. Close this dialog:

    Creating API functional tests in SoapUI: Additional options

You can see the project in the Navigator panel on the left. On the next step of this tutorial, we will explore the created project, the service and its operations.

Prev     Next

See Also

Creating Your First Functional Test
About Projects Page

Highlight search results