Applies to ReadyAPI 2.2, last modified on November 17, 2017

ReadyAPI includes a large set of standard and specialized assertion types that you can customize to suit any combination of API calls. You can create assertion chains, various scenarios and automated workflow.

Organizing and Running Assertions

You can use assertions to validate the message the test step receives. Usually, it compares some node of the request or response to the value you expect to get.

Each test step can use multiple assertions, so you can validate various aspects and content parts of the request or response.

After the execution of a test step, ReadyAPI applies all its assertions to the request or response. If any assertion fails, the test step will appear as failed in the test case view. A corresponding FAILED entry will appear in the test execution log.

ReadyAPI: The failed assertion in the transaction log

Click the image to enlarge it.

ReadyAPI provides a complete solution for the verification process, allowing you to perform all the steps and testing them at the same time. This allows you to separate setup problems from execution, and derive operation results and stating issues. With this approach, you can easily perform the validation and find the origin of the problems.

Assertion Categories

There are several categories of assertions in ReadyAPI. During the run, only assertions available to a specific test step will be enabled.

In the Recently category, there are 5 assertions you have recently used. Some of these assertions may also be disabled due to the source and property restrictions.

To learn more about specific categories and assertions, see Assertions Reference.

Managing Assertions

The Assertions panel is similar in SoapUI, Secure and ServiceV.

The following screenshot depicts 3 assertions within a SOAP Request test step. The first two of them have passed correctly, and the last one has failed.

ReadyAPI: The Assertions panel

Click the image to enlarge it.

Adding Assertions

To add a new assertion, click .

The Add Assertion dialog appears.

ReadyAPI: The Add Assertion dialog

Click the image to enlarge it.

  1. Select an assertion category.

  2. Select a specific assertion.

  3. Click Add.

The assertion will appear on the list.

Configuring Assertions

To configure the assertion, click .

For different assertions, the available settings may vary. To learn more about the specific assertion settings, see Assertions Reference.

Removing Assertions

To remove the assertion, click .

Changing Order of Assertions

To change the order of assertions, use the arrow buttons.

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

Cloning Assertions

To clone an assertion, click .

The Clone Assertions dialog appears.

ReadyAPI: The Clone Assertions dialog

Click the image to enlarge it.

Here, the following options are available:

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.

Specify the parameters you need, click Apply or OK to apply the changes, and close the dialog.

See Also

Verifying Results
Assertion Reference
Assertion Coverage