Creating Functional Tests

Applies to ReadyAPI 3.56, last modified on October 29, 2024

There are multiple ways to create a functional test in ReadyAPI. In this topic, you can find step-by-step instructions on how to do this.

From Endpoint Explorer

The Endpoint Explorer provides an easy way to check the functionality of a REST API endpoint. You can send a REST request, view the response, and create a functional test for the endpoint on the spot.

To open the Endpoint Explorer:

Select Send a REST Request on the start page.

– or –

Select Endpoint Explorer on the main navigation bar:

Opening Endpoint Explorer

Click the image to enlarge it.

To create a test:

  1. Select a request method from the Method dropdown.

  2. Enter the URL of your API in the Endpoint field.

  3. Click + Add header and specify headers, if needed:

    Entering API parameters

    Click the image to enlarge it.

  4. Switch to the Body tab and enter a request body, if needed.

  5. Click Send to make an API call, and then view the response:

    The received response

    Click the image to enlarge it.

  6. Click Create test:

    Creating a test

    Click the image to enlarge it.

  7. Select the project to which you want to add the test and click Next:

    Select project

    Click the image to enlarge it.

  8. Select the assertions to be added to your test and click Next:

    Adding assertions

    Click the image to enlarge it.

  9. ReadyAPI will create a project and display a confirmation dialog. In the dialog, click Run to run the created functional test, or click Add Data to create a data-driven test that will use an Excel data source. If you don't want to perform any of the operations, just close the dialog.

From API definition

You can create a functional test based on a WSDL, OpenAPI, Swagger, WADL, or AsyncAPI definition or a GraphQL schema.

  1. Select File > New Functional Test.

    – or –

    On the Dashboard, click Functional Test in the New Test tile:

    Functional testing with ReadyAPI: Create a functional test
  2. In the New Functional Test wizard, select the API Definition option and click Start.

    Creating a functional test from an API definition

    Click the image to enlarge it.

  3. Select how to input your API definition. You have two options:

    • File

      • Enter the file path or URL of the API definition in the field provided.
      • Alternatively, click the Browse button to locate and select the file from your computer.
      Specifying the API definition file

      Click the image to enlarge it.

    • SwaggerHub Integration

      • Import an API definition from SwaggerHub. This option is available if you've integrated ReadyAPI with your SwaggerHub account. For more details on integration, see the SwaggerHub integration page.
      • Select one of the following options:

        • My API: Search for and select an API from your private SwaggerHub account.
        • Public API: Search for and select an API from publicly available APIs on SwaggerHub.
        Importing API definition from SwaggerHub

        Click the image to enlarge it.

    Tip:

    Use the Filters button to refine the API list:

    • Select specific API specifications: OAS2, OAS3, OAS3.1, AsyncAPI, or All.
    • Optionally, select Private or Public for My API.
    • Click Select All or Deselect All to manage your filter selections.

    Click Next.

  4. Specify the project to add the new test to and click Next.

    Specifying the project

    Click the image to enlarge it.

  5. Select the assertions to be added to new requests and click Next.

    Adding assertions

    Click the image to enlarge it.

  6. You can create a single test case for all requests in the API definition or a separate test case for each request:

    Selecting a test group

    Click the image to enlarge it.

  7. Click Finish.

  8. ReadyAPI will create a project and display the confirmation dialog. In this dialog, you can run the created functional test or create a data-driven test that uses the Excel data source. If you do not need either, close the dialog.

From endpoint

You can create a functional test based on a URL of your REST service.

  1. Select File > New Functional Test.

    – or –

    On the Dashboard, click Functional Test in the New Test tile.

  2. In the New Functional Test wizard, select the Endpoint option and click Start.

    Creating a functional test from a URL

    Click the image to enlarge it.

  3. Enter the URL of your REST service. You can specify multiple URLs to create separate requests from.

    Specifying a URL

    Click the image to enlarge it.

  4. Specify the project to add the new test to and click Next.

    Specifying the project

    Click the image to enlarge it.

  5. Select the assertions to be added to new requests and click Next.

    Adding assertions

    Click the image to enlarge it.

  6. You can create a single test case for all specified URLs or a separate test case for each request:

    Selecting a test group

    Click the image to enlarge it.

  7. Click Finish.

  8. ReadyAPI will create a project and display the confirmation dialog. In this dialog, you can run the created functional test or create a data-driven test that uses the Excel data source. If you do not need either, close the dialog.

From ReadyAPI project

If you already have an API in the workplace, you can create a test for it.

  1. Select File > New Functional Test.

    – or –

    On the Dashboard, click Functional Test in the New Test tile.

  2. In the New Functional Test wizard, select the ReadyAPI Project option and click Start.

  3. Select requests to be added to your test suite. The requests you select must be in the same project.

  4. You can create a single test case for all requests in the API or a separate test case for each request:

  5. Click Finish.

  6. ReadyAPI will create a project and display the confirmation dialog. In this dialog, you can run the created functional test or create a data-driven test that uses the Excel data source. If you do not need either, close the dialog.

Generate test suites

One of possible ways to create a functional test is to generate it from a service specification that you have in your project. This is an easy way to get a functional test with a test suite and test cases.

To generate a functional test from a service specification:

  1. Right-click a service in the Navigator and select Generate Test Suite from the context menu.

    Functional testing with ReadyAPI: Generate Test Suite

    Click the image to enlarge it.

    –or–

    Select a service in the Navigator, and then select API > Generate Test Suite.

    Functional testing with ReadyAPI: Generate TestSuite

    Click the image to enlarge it.

  2. In the subsequent Generate Test Suite dialog:

    Functional testing with ReadyAPI: Generate Test Suite dialog
    • Select <create> from the Test Suite drop-down list to create a new test suite.

    • Select one of the following Style options:

      Option Description
      One Test Case for each Resource Creates one test case per a resource.
      Single Test Case with one Request for each Method Creates a single test case for all resources.
    • Select the corresponding Request Content option either to use existing requests or to create empty requests.

    • Select resources to be included in the test.

    • Select the Generate LoadUI Test check box if you want to have a load test for each generated test case.

    • Click OK.

  3. Enter a new test suite name. Click OK.

    Functional testing with ReadyAPI: New Test Suite Name

ReadyAPI will show the created functional test in the Navigator.

See Also

ReadyAPI Documentation
Creating New Load Tests
Creating Security Tests
Creating Virtual Services

Highlight search results