Applies to ReadyAPI 2.6, last modified on January 15, 2019

Use ReadyAPI assertions to validate response and request contents: response codes, header values, specific fields in JSON and XML response bodies, and so on. To learn more about available assertions and their parameters, see Assertion Reference.

For any test step, add one or multiple assertions to check if it gets and returns data in expected format and functions correctly.

Create assertions

  1. Open a test step in the editor and click Add Assertion.

    SoapUI: The Add Assertion button

    Click the image to enlarge it.

  1. Open a security test, click Response Assertions next to a security scan, and click Add in the Assertions panel.

    Secure: The Assertions panel

    Click the image to enlarge it.

  1. Expand the Assertions drop-down menu on the right of the virtual service editor and click Add.

    ServiceV: The Assertions panel

    Click the image to enlarge it.

  1. In the Add Assertion dialog, select an assertion category, pick an assertion, and click Add. The assertion will be added to the Assertions panel.

    Note: Some assertions may be missing from the dialog. It happens because they are not applicable to the currently selected test step or operation.
    The Recently category of the dialog lists 5 recently used assertions.
  2. Configure and order your assertions in the Assertions panel.

Clone assertions

You can clone assertions you used in a request or response and apply them to another test step in the same or another test case or project. To do this, click Clone on the toolbar of the Assertions panel and configure the following options as needed and apply the changes:

ReadyAPI: The Clone Assertions dialog

Click the image to enlarge it.

Option Description

Assertions

A list of available assertions to clone.

Target Project

A project to clone the assertion to.

Target TestSuite

A test suite to clone the assertion to.

Target TestCase

A test case to clone the assertion to.

Target TestSteps

A list of available test steps to clone the assertion to.

Overwrite

Assertions of some types can be added several times to a test step, while assertions of some other types can be added only once. The Overwrite option affects cloning of such “one-instance” assertions:

  • If the option is on, clones will replace such assertions in the target test steps.

  • If the option is off, clones will not replace the existing assertions.

The option does not affect multiple-instance assertions: ReadyAPI always adds copies of these assertions to the assertion list.

Clear Existing

Removes any existing assertions with the same name.

Open List

Displays the list of updated test requests.

Assertions panel

The Assertions panel lists the assertions you added to a test step or operation. Here, you can add and modify the assertions.

To access the Assertions panel:

SoapUI: The Assertions panel

Click the image to enlarge it.

Secure: The Assertions panel

Click the image to enlarge it.

ServiceV: The Assertions panel

Click the image to enlarge it.

Use the panel toolbar to manage assertions:

Command Description
Add

Click to add a new assertion.

Clone

Click to copy the selected assertion with all its settings and parameters to another test step in the same or another test case or project. See Clone assertions for details.

Remove

Click to delete the selected assertion.

Up and Down

Click to change the position of the selected assertion in the panel.

The assertion order is important. ReadyAPI runs assertions in the order you have specified, from the topmost to the bottom one.

The image below shows three assertions applied to a SOAP request test step. The first two passed correctly, and the last one failed:

ReadyAPI: The Assertions panel

Click the image to enlarge it.

Highlight search results