Adding a Validation to an Action

How to

  1. In the Expanded view, use the mouse to hover over the clip element.
  2. Click the Valdiations node on the Add toolbar.When you do so, a new Validation form is added.
    • To open an action in the lower panel, select and then double-click it.
  3. Select a validation from the Command drop-down. The Command drop-down presents the list of available validations (prefixed with verify ...). Subsequent parameters depend upon the wait selection made here.
    In the default validation (above) verifyElementPresent , Locator is the only parameter of the selected command that requires definition. As you choose different options in the Command drop-down, different parameters appear underneath it.
  4. Where required, enter a locator. You can copy and paste a Locator from the Input field of a given action.Note: Locators are unique characteristics that identify a specific element or object for the given action. The form of the Locator generally varies according to the type of validation. For a browser or app action it may be the name of an element on the page such as submitButton or classname=PieceImageView[13] .
  5. Select a Failure Action from the Errors should: drop-downThe Errors should drop-down specifies what failure action to take when the validation condition is not met.
    • If the failure action is set to be recorded only, the validation outcome will be recorded in the result, and the test composition will continue whether the validation passes or fails.
    • If the failure action is set to fail the Clip, the test composition will stop if the validation fails.
    • If the failure action is set to Honor the (Browser or App) Action or Message setting, the validation inherits the parent setting from the action/message.
  6. Where required, specify a pattern to match.Many validations compare text by matching the pattern of some text on the page in order to determine if that page is correct. The following pattern match types are offered:
    • Exact Match – matches against the string exactly
    • Glob – matches against a pattern using Java glob notation.
    A glob is a limited regular expression pattern. In a glob pattern, * represents any sequence of characters, and ? Represents any single character. Many personal computer users are familiar with globs through file matching expressions such as “*.jpg.”
    • RegEx – matches against a regular expression using Java regular expression notation.
    Note: CloudTest script authors should note that the Regular expressions within a CloudTest script (via the RegExp object or the /pattern/ notation) are JavaScript regular expressions. These JavaScript regular expression versions differ in important ways and the two are not interchangeable, so expressions cannot be copied from a CloudTest script to an include/exclude for pages, to a session template, or to a Wait, PropSet, or Validation, and vice versa. Some validations have additional fields, such as the Property field shown above for verifyElementPropertyValue .
  7. Optionally, double-click the Action to open it in the lower panel in order to customize its Success/Error messages. Click Show/hide to add or revise Success/Error messages for display in results. The log message fields specify custom messages to show in Result Details when the validation passes or fails.

What you should see