Message Content Assertion

Important

The Message Content assertion has been superseded by the Smart Assertion as of ReadyAPI 3.9.0. The assertions will continue to be available, but we recommend transitioning to Smart Assertions.

The Message Content assertion checks the content of messages and properties in accordance with the predefined set of rules.

To use this assertion, you need a ReadyAPI Test Pro license. If you do not have it, request it on our web site or start a trial.

Availability

This assertion is available in multiple ReadyAPI applications. Depending on the application, it validates the following data:

In...

Checks...

To learn more...

Functional tests

The request or response contents.

See Working With Assertions in Functional Tests.

Security tests

The response contents.

See Security Assertions.

Virtual services

The request contents.

See Assertions in Virtual Services.

Create an assertion

Setting up properties

Important

Send the request at least once, to be able to parse the message.

When you add the assertion, ReadyAPI sets the default settings for it. If you are satisfied with the setting, click Save. Otherwise, change the assertion settings:

ReadyAPI: Configuring the Message Content assertion
  1. Select the check box next to the node you want to verify.

    ReadyAPI will add the AND operator between the nodes.

  2. Select the comparison operator from the matching drop-down list.

  3. Specify the value you need in the Expected Value column.

If needed, click Reconfigure to reload the values from the last response you have got.

To remove all the selected operators and the expected values, click Clear.

Comparison operators

The assertion uses the following comparison operators:

Operator

Description

=

Checks whether the actual node value equals the expected value.

!=

Checks whether the actual node value does not equal the expected value.

>

Checks whether the actual node value is greater than the expected value. For non-numeric values it always fails.

<

Checks whether the actual node value is less than the expected value. For non-numeric values it always fails.

>=

Checks whether the actual node value is not less than the expected value. For non-numeric values it always fails.

<=

Checks whether the actual node value is not greater than the expected value. For non-numeric values it always fails.

exist

Checks whether a node exists in the received message.

not exist

Checks whether a node does not exist in the received message.

contains

Checks whether a node contains the expected value. Case-sensitive.

not contains

Checks whether a node does not contain the expected value. Case-sensitive.

regex

Checks whether the actual value matches the specified regular expression.

Other assertions for content

Add more assertions for response and request contents:

See Also

Publication date: