SoapUI Assertion - Contains



A large number of assertions are available for validating received messages, some being specific for a certain type of TestStep and some being common for all TestSteps. The assertions available for all TestSteps are −

  • Contains − Checks for the existence of a specified string.

  • Not Contains − Checks for the non-existence of a specified string.

  • Response SLA − Checks the response time against a specified value.

  • XPath Match − Compares the result of an XPath expression to an expected value.

  • XQuery Match − Compares the result on an XQuery expression to an expected value.

  • Script − Runs an arbitrary script that can be used to validate the received message as desired.

Contains Assertion

Contains Assertion checks the existence of a specified string in a response message.

By default, there is no assertion.

Step 1 − Click “Add a new assertion” to add an assertion.

The number of assertions added will be displayed in the assertion tab.

New Assertion

Step 2 − Select the Assertion Category – Property Content.

Step 3 − Select the Assertion Type – Contains.

Step 4 − Click Add.

Add Assertion

Step 5 − Validate whether the attribute text, ConversionRateResult text is present or not in the response. Enter the text/expected string in the Content textbox.

Conversion Rate Result

Step 6 − Click OK. If the response message is available, assertion executes immediately and displays whether the assertion is valid or invalid.

Response Message
soapui_assertions.htm
Advertisements