Applies to ReadyAPI 2.3, last modified on April 25, 2018

In ReadyAPI, you use assertions to validate response and request contents. ReadyAPI includes dozen of various assertion types that help you validate different parts of requests and responses: response codes, header values, specific fields in JSON and XML response bodies, and so on. For any test step, you can add one or multiple assertions to check if it gets and returns data in expected format and functions correctly.

Create Assertions

To create and configure assertions, you use the Assertions panel:

  1. The Assertions panel is available in the test step editor:

    SoapUI: The Add Assertion button

    Click the image to enlarge it.

  1. To view the Assertions panel, click Response Assertions for a security scan. The panel will appear on the right:

    Secure: The Add Assertion button

    Click the image to enlarge it.

  1. The Assertions panel is available as the drop-down menu on the right side of the virtual service editor:

    ServiceV: The Add Assertion button

    Click the image to enlarge it.

  1. To create an assertion, click on the toolbar of the Assertions panel. This will invoke the Add Assertion dialog box:

    ReadyAPI: The Add Assertion dialog

    Click the image to enlarge it.

  2. In the dialog, select an assertion category, pick the assertion you need and click Add. The assertion will be added to the panel.

Note that some assertions can be disabled in the dialog, because they are not applicable to teh currently selected test step. The Recently category of the dialog lists 5 recently-used assertions.

Use the panel toolbar to configure assertions:

Command Description

Select an assertion in the panel and click this button to configure the assertion settings. For more information on assertion properties, see Assertions Reference.

Select an assertion in the panel and click this command to delete the assertion.

Arrow buttons

Use them to change the position of an assertion in the panel.

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

The following image shows 3 assertions applied to the SOAP Request test step. The first two have passed correctly, and the last one has failed:

ReadyAPI: The Assertions panel

Click the image to enlarge it.

Invokes the Clone Assertion dialog, where you can copy an 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.

Assertion Parameters

ReadyAPI organizes assertions into several categories. You can see them in the the Add Assertion dialog box. Some assertions validate response contents, some others check the structure of a message body, verify headers, and so on. To learn more about available assertions and their parameters, see Assertion Reference.

See Also

Verifying Results
Assertion Reference
Clone Assertions Dialog