- SoapUI Tutorial
- SoapUI - Home
- SoapUI Basics
- SoapUI - Introduction
- SoapUI - Capabilities
- SoapUI - NG Pro
- SoapUI - Installation & Configuration
- SoapUI - WSDL
- SoapUI - Project
- SoapUI - TestSuite
- SoapUI - TestCase
- SoapUI - TestStep
- SoapUI - Request & Response
- SoapUI - Properties
- SoapUI - Property Transfer
- SoapUI - Logs Pane
- SoapUI - Assertions
- SoapUI - Troubleshooting
- SoapUI - Performance Testing
- SoapUI - Load Testing
- SoapUI - RESTful Web Services
- SoapUI - JDBC Connection
- SoapUI - JDBC Property
- SoapUI - JDBC Assertion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 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.
Step 2 − Select the Assertion Category – Property Content.
Step 3 − Select the Assertion Type – Contains.
Step 4 − Click Add.
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.
Step 6 − Click OK. If the response message is available, assertion executes immediately and displays whether the assertion is valid or invalid.