Applies to ReadyAPI 2.4, last modified on June 7, 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. From the main menu, select File > New Functional Test:

    Creating API functional tests in SoapUI: New Functional Test Button

    – or –

    Switch to the Dashboard and in its New Test tile, select All Tests and click Functional Test:

    Functional testing with ReadyAPI: Create a functional test
    Note: The New Test tile you see on your screen may differ from the one descried above, because the tile content depends on the ReadyAPI license you have. For details, see the tile description.
  2. In the subsequent dialog box, select API Definition:

    Creating API functional tests in SoapUI: New Functional Test Dialog
    Note: If you have an open project in ReadyAPI, the dialog box will display one more option – “ReadyAPI Project: API from an existing project”.
  3. 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 Next to continue.

  4. On the next page of the wizard, 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 Next to continue.

  5. On the last page of the wizard, 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 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