Create Functional Test

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.

Using SmartBear AI

ReadyAPI AI generates test cases from your API definition using natural language instructions. Import an API definition, describe the test scenario you want to test, choose a response profile, select the assertion types you need, and generate a complete test case in seconds. You can then review, edit, or run your generated test case.

Install and enable SmartBear AI

Before you generate tests, install and enable the SmartBear AI plugin.

Install the plugin

  1. Open ReadyAPI.

  2. Click Integrations.

  3. Find ReadyAPI AI Plugin.

  4. Click Install.

  5. In the Download Plugin dialog, click Yes to confirm.

    After installation, ReadyAPI adds the Open SmartBear AI button to the top-right corner.

    The Open SmartBear AI button appears disabled until you enable SmartBear AI.

Enable or disable SmartBear AI in ReadyAPI

Control SmartBear AI from the ReadyAPI UI

To enable the SmartBear AI features, follow these steps:

  1. Click Preferences.

  2. In the ReadyAPI Preferences dialog, in the left pane, go to Integrations, and select SmartBear AI.

  3. Select Enable SmartBear AI integration.

  4. Select OK.

    After you enable SmartBear AI, the Open SmartBear AI button becomes active in the navigation bar. Click this button to open the Generate Tests with SmartBear AI dialog.

Control SmartBear AI in managed deployments

Organizations that deploy ReadyAPI as a managed image can also control SmartBear AI availability with a JVM option. This setting disables AI features at startup and removes AI-related options from the ReadyAPI UI.

  • Use the following JVM option: -Dreadyapi.enable.ai.features=<value>

  • To turn off all AI features, set the value to: -Dreadyapi.enable.ai.features=false

At a glance: Generate a test case with SmartBear AI

After you enable SmartBear AI integration, click Open SmartBear AI to open the Generate Tests with SmartBear AI dialog. You can now generate test cases:

  1. Import an API definition.

  2. Describe your test scenario in natural language.

  3. Select a response profile (Performance or Accuracy).

  4. Select the assertions you want included in the generated test case.

  5. Click Generate Test Case to create the test.

  6. Review and resolve validation errors, if any.

  7. Review the generated test case.

  8. Share feedback or report issues.

Steps 6–8 outline recommended follow-up actions to take after generating a test case.

Generate Tests with SmartBear AI dialog showing fields for API Definition, Prompt, optimization options, and assertion settings.

Import an API definition

Import your API definition from a local file or through your Swagger Studio integration. After import, ReadyAPI displays the operations and schemas available for test generation.

Note

If the imported definition file does not include a base URL, SmartBear AI creates a project property named baseURL. Use this property to define the base request URL for generated test steps. Each test step URL uses the following format: ${#Project#baseURL}/foo/bar

Describe your test scenario

Enter a natural-language description of the scenario you want to test. ReadyAPI uses this description to shape the request flow, data, and assertions included in the generated test case.

Examples of scenario descriptions:

  • Example 1: Create a test that creates a pet, updates it, and deletes it.

  • Example 2: After logging in, purchase a pet, verify the stock shows the pet is sold, and log out.

  • Example 3: Log in, create a pet named "Fido", sell “Fido,” update the status to "sold", verify the pet status is sold, and log out.

Select a response profile

Choose how SmartBear AI balances speed and analysis:

  • Performance: Generates results quickly with lightweight processing. Use this profile for rapid iteration or most everyday test-generation scenarios.

  • Accuracy: Generates more detailed and deeply analyzed test scenarios. This profile takes slightly longer but provides more precise and comprehensive results.

Select assertion types

Add the assertion types you want SmartBear AI to include in your generated test case.

  • Validate HTTP Response Status: Checks whether the test step receives an HTTP status code defined in the API specification.

  • Validate Swagger/OpenAPI Compliance: Verifies whether the response matches the API definition.

    The assertion supports the following specifications:

    • Swagger 2.0 (OpenAPI 2.0)

    • OpenAPI 3.0.0

    • OpenAPI 3.1.0

  • Validate Response SLA: Checks whether the response arrives within a defined time limit.

Generate test cases

After you complete your inputs, generate your test cases with a single action. SmartBear AI creates the test steps and assertions based on your description and the imported API definition.

ReadyAPI creates a new project in the Project Workspace under Functional Tests and adds an AI-Generated Test Suite that contains the generated test case.

ReadyAPI Navigator showing a generated test case with steps named Create New Pet, Retrieve Created Pet, Update Pet Status, Verify Status Update, and Delete Pet under the Pet Management Lifecycle Test Suite.

Test naming behavior

ReadyAPI assigns test and test step names based on the generated scenario. The names reflect the actions performed in each step, such as creating, retrieving, updating, verifying, or deleting resources.

Run the generated test case

After the test case is generated, you can review and edit it in the ReadyAPI UI, or run it using the GUI, TestRunner, or TestEngine, depending on your testing workflow.

Review and resolve validation errors

SmartBear AI generates a test case from the imported API definition and your prompt. ReadyAPI parses the AI response and adds the generated test case to the Project Workspace Navigator for review.

In some cases, ReadyAPI displays validation or parsing error messages during this process. These messages usually indicate issues parsing the AI-generated response, such as formatting inconsistencies or incomplete data exchanged between SmartBear AI and ReadyAPI. The following image shows an example.

RAPI_Screenshot_Error.png

Click OK to dismiss these messages and review the generated test case. If the test case fails to execute or behaves unexpectedly, include the error details when you submit a SmartBear Support request.

Review the generated test case

To review the test case after generation and confirm it behaves as expected, do the following:

  • Run the test case and check whether it executes successfully.

  • Review assertions and verify whether they pass or fail as expected.

If a test fails, check the following:

  • The API definition is complete and valid.

  • Requests and responses in the test case contain valid data.

  • Assertion logs to understand why the test failed and whether the failure reflects a real issue.

Share feedback or report issues

You can submit feedback directly from the Generate Tests with SmartBear AI dialog in ReadyAPI.

If the issue persists or prevents successful execution, submit a SmartBear Support request and include any validation or parsing errors you encountered.

Disable SmartBear AI in SLM

By default, SmartBear AI features are enabled for ReadyAPI in SmartBear License Management (SLM) for your organization.

To disable SmartBear AI for all SLM users in your SLM organization, submit a SmartBear Support request with the following information:

  • Issue Type: Other

  • Request: Disable SmartBear AI for your SLM organization

  • Details: Include the exact SLM organization name

Disabling AI at the SLM level blocks all users in that organization from accessing AI features in ReadyAPI.

See Also

From Endpoint Explorer

Use Endpoint Explorer to send a request, view the response, and create a functional test.

Open Endpoint Explorer in one of the following ways:

  • Click Send in the REST Request tile on the Starter Page

  • Click Endpoint Explorer in the main menu

ReadyAPI interface showing how to open Endpoint Explorer from the REST Request option on the start page or from the Endpoint Explorer option in the top navigation, with the Endpoint Explorer dialog displayed.

To create a test:

  1. Select a request method from the Method dropdown.

  2. Enter your API URL in the Endpoint field.

  3. In the Request section, click Add header and add the required headers.

    ReadyAPI Endpoint Explorer showing a POST request to the Petstore v3 /pet endpoint with Content-Type set to application/json.
  4. Open the Body tab and enter the request body.

  5. Click Send and review the response returned by the API.

    ReadyAPI Endpoint Explorer showing a POST request to the Petstore v3 /pet endpoint with a JSON request body and a successful 200 OK response
  6. Click Create test.

  7. Select a project where you want to create the test, or keep <New project>, and click Next.

    ReadyAPI Endpoint Setup dialog showing the option to add a new functional test to a new or existing project.
  8. Select the assertions to include in the test (for example, HTTP status code and response time), then click Next.

    ReadyAPI Endpoint Setup dialog showing default assertions such as HTTP status code and response SLA selected for a new functional test.

    ReadyAPI creates the test and prompts you to run it or add a data source.

  9. Click Run Test Case to execute the test, or click Add a Data Source to create a data-driven test using a file (for example, Excel).

From API definition

Create a functional test from an API definition such as OpenAPI, Swagger, WSDL, WADL, AsyncAPI, or GraphQL.

  1. Start a new functional test in one of the following ways:

    • From the main menu, select File, and then New Functional Test.

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

  2. In the New Functional Test wizard, select the API Definition option.

    Create a functional test dialog in ReadyAPI with the API Definition option highlighted.
  3. Select how to provide the API definition:

    • File: Enter the URL of an API definition (for example, an OpenAPI or Swagger JSON file), or browse to select a local file.

      API Definition Setup dialog showing a URL entered for an OpenAPI definition using the File option.
    • Swagger: Select My API for private APIs or Public API for public APIs.

      API Definition Setup dialog showing the Swagger Public API option with a list of available APIs.

      Note

      This option is available if you've integrated ReadyAPI with your Swagger Studio account. For more details on integration, see the SwaggerHub integration page.

    Click Next.

    Tip

    Use the search field and filter options to refine the API list:

    • Use the specification dropdown (for example, OAS2, OAS3, AsyncAPI, or All)

    • Use the Type dropdown to filter APIs (for example, In project or Update available)

    • Enter keywords in the search field to find a specific API

  4. Select a project where you want to create the test, or keep <New project>, and click Next.

    API Definition Setup dialog showing the Specify project step with a dropdown to select or create a project.
  5. Select the assertions to include in the test (for example, HTTP status code and response time), then click Next.

    API Definition Setup dialog showing assertion options such as HTTP status code validation and response time limits.
  6. Select how to organize the test cases:

    • Create a single test case for all requests, or

    • Create separate test cases for each request

    Click Create test.

    API Definition Setup dialog showing options to create a single test case or multiple test cases.

    ReadyAPI creates the test and prompts you to run it or add a data source.

  7. Click Run Test Case to execute the test, or click Add a Data Source to create a data-driven test using a file (for example, Excel).

From Endpoint

Create a functional test from the URL of your REST service.

  1. Start a new functional test in one of the following ways:

    • From the main menu, select File, and then New Functional Test.

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

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

    Select the Endpoint option when creating a new functional test in ReadyAPI.
  3. Enter the URL of your REST service. To create multiple requests, add additional URLs.

    Enter the request method and API URL when creating a functional test from an endpoint in ReadyAPI.
  4. Select a project where you want to create the test, or keep <New project>, and click Next.

    Select a project when creating a functional test from an endpoint in ReadyAPI.
  5. Select the assertions to include in the test (for example, HTTP status code and response time), then click Next.

    Select assertions such as HTTP status code and response time when creating a functional test from an endpoint in ReadyAPI.
  6. Select how to organize the test cases:

    • Create a single test case for all requests, or

    • Create separate test cases for each request

    Click Create test.

    Choose between a single test case or multiple test cases when creating a functional test in ReadyAPI.

    ReadyAPI creates the test and prompts you to run it or add a data source.

  7. Click Run Test Case to execute the test, or click Add a Data Source to create a data-driven test using a file (for example, Excel).

From ReadyAPI project

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

  1. Start a new functional test in one of the following ways:

    • From the main menu, select File, and then New Functional Test.

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

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

    Select the ReadyAPI Project option when creating a new functional test in ReadyAPI.
  3. Select an API from an existing project. ReadyAPI includes its requests in the test suite.

    Select an API from an existing ReadyAPI project when creating a functional test.
  4. Select how to organize the test cases:

    • Create a single test case for all requests, or

    • Create separate test cases for each request

    Click Create test.

    Choose between a single test case or multiple test cases when creating a functional test from an existing ReadyAPI project.

    ReadyAPI creates the test and prompts you to run it or add a data source.

  5. Click Run Test Case to execute the test, or click Add a Data Source to create a data-driven test using a file (for example, Excel).

Generate test suites

Generate a functional test from a service in your project. This creates a test suite with test cases for each operation.

To generate a functional test from a service specification:

  1. In the Navigator, right-click a service and select Generate Test Suite from the context menu.

    Right-click menu on a service in the Navigator showing the Generate Test Suite option selected.

    You can also select a service and from the main menu, click API, and then Generate Test Suite.

    Main menu in ReadyAPI showing the Generate Test Suite option.
  2. In the Generate Test Suite dialog:

    • Select <create> to create a new test suite.

    • Choose how to organize test cases.

    • Select the resources to include.

    • Choose whether to use one test case per resource or per method.

    • (Optional) Enable load test creation.

    Click OK.

    Generate Test Suite dialog showing options for test suite name, test case structure, and selected resources.
  3. Enter a new test suite name, and click OK.

    Dialog for entering a test suite name in ReadyAPI.

ReadyAPI displays the created test suite in the Navigator.

See Also

Publication date: