9. Run the Test

Applies to ReadyAPI 3.54, last modified on July 23, 2024

Configure the request

To use the data from a data source, you need to modify the request test step.

  1. Open the Request 1 step editor and switch to the Request tab. If you created the data source loop earlier, the request will contain the ${Data Source#email} value:

    Functional API testing: The request with a dynamic value

    Click the image to enlarge it.

    If the email parameter has another value, type ${Data Source#email} in it or use the Get Data command to select the email property with a special wizard.

    Show Steps

  2. Click Send request on the editor toolbar to run the request.

    You will see the response data on the right:

    Functional API testing: Received response

    Click the image to enlarge it.

    Note: If you did not test the data source on the previous step, the property does not have a value, so the request does not send a valid parameter.

Run the test

Now, you have a test case with a data source, a test step that uses this source, and a data source loop executed during the test run.

Your test case is ready. Click on the test case toolbar to run the test.

Functional API testing: The REST Request test case

To see the details of the test run, take a look at the Transaction Log. To open the log, click Transaction Log on the test case toolbar.

Functional API testing: Finished test case run

Click the image to enlarge it.

The Transaction Log shows the following test run details:

Functional API testing: The transaction log

Click the image to enlarge it.

You did not use any assertions to validate requests, so the assertion status for the request is UNKNOWN. You can see it in the Status column. The data source and the data source loop are always Passed, since it is impossible to assert them.

To check the response for a particular request made during the run, click Open in the respective row:

ReadyAPI: Check the response

Click the image to enlarge it.

Add assertion

  1. Switch to the REST Request and click Smart Assertion:

    Functional API testing: Smart Assertion button

    Click the image to enlarge it.

  2. ReadyAPI will create an assertion based on the most recent response and automatically configure which values are expected for which data fields:

    Functional API testing: Smart Assertion

    Click the image to enlarge it.

  3. You can uncheck boxes to exclude certain fields from the assertion or configure comparison operators and expected values. When you are done, click Save:

    Functional API testing: Configure assertion

    Click the image to enlarge it.

You have added the Smart Assertion to your test request. It will verify that the response data matches the expected values. You can find the added assertion in the Assertions panel:

ReadyAPI: The REST request with the assertion

Click the image to enlarge it.

Prev

See Also

Microsoft SQL Databases as Data Sources

Highlight search results