User-Defined Validations on Response Body
Use the following steps if Response Body was chosen above.
- Specify an XPath to validate.
- Specify the Response Type from among: XML, SOAP, JSON, PHP, HTML, or Text.
- Specify the Match type from among:
For example, the user-defined validation below is on the message’s response body using the specified XPath and the HTML response and is set to Matches exactly. Subsequent actions on the validation will depend whether the response does in fact match.
- Matches exactly
- Does not match exactly
- Matches regular expression
- Does not match regular expression
- Matches glob expression
- Does not match glob expression
- The following script is expected to succeed
- The following script is expected to fail
- Existing script is expected to succeed
- Existing script is expected to fail
- Next, specify whether to validate based on a Constant expression or a Property type.
- If Constant expression is selected, enter the expression.
- If Property type is selected, additional fields appear below. A constant expression is an expression in which each operation is intrinsic
- Specify a Failure Action: from among: Fail the Clip, Record in Results only, or Honor the Message setting.
What you should see
For example, the following user-defined validation uses a custom property whose owner is the Clip.
- In the example (right), the property type was chosen from among Custom, System, or Global property.
- The Owner was specified from the list of CloudTest objects (e.g. Composition, Band, Track, Clip, Target, Destination, Chain, or Message).
- The property name in this case was __EVENTVALIDATION.
- The Failure Action was chosen from among Fail the Clip, Record in results only, or Honor the Message setting.