Applies to ReadyAPI 2.7, last modified on May 14, 2019

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 SoapUI  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...
SoapUI functional tests The request or response contents. See Working With Assertions in SoapUI.
SoapUI security tests The response contents. See Security Assertions.
ServiceV The request contents. See Assertions in ServiceV.

Automatic configuration

In SoapUI, you can add the Message Content assertion whose configuration is based on previously received responses. To do this, click Smart Assertion in the Response editor:

Assertions in ReadyAPI: Add smart assertion

Click the image to enlarge it.

ReadyAPI will analyze the received responses and configure the assertion based on the found patterns.

Create an assertion

Follow these steps:

SoapUI: The Assertions panel

Click the image to enlarge it.

  1. Open a test step.

  2. Click Add assertion.

In the New Assertions dialog, search for the Message Content assertion or select it manually in the Property Content category.

Follow these steps:

Secure: The Assertions panel

Click the image to enlarge it.

  1. Open a security test.

  2. Select Response Assertion.

  3. Click in the Assertions panel

In the New Assertions dialog, search for the Message Content assertion or select it manually in the Property Content category.

Follow these steps:

ServiceV: The Assertions panel

Click the image to enlarge it.

  1. Open a virtual service.

  2. Open the Assertions drop-down panel.

  3. Click in the Assertions panel

In the New Assertions dialog, search for the Message Content assertion or select it manually in the Property Content category.

Setting up properties

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

Click the image to enlarge it.

  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

Property Content Assertions
Contains Assertion
Not Contains Assertion

Highlight search results