|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.
This assertion is available in multiple ReadyAPI applications. Depending on the application, it validates the following data:
|In...||Checks...||To learn more...|
|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
|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:
Select the check box next to the node you want to verify.
ReadyAPI will add the
ANDoperator between the nodes.
Select the comparison operator from the matching drop-down list.
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.
The assertion uses the following comparison operators:
||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: