Validate script action

Validate action

A Validate action stops execution of a script if a specified text string is present or absent, as defined, in a specified step; or if a specific HTTP status code is not returned.

Best practice is to add a Validate action at the end of each step to confirm that the script executed properly.

There are two validation modes:

  • Match against all content loaded during this step – Validate that the text is present in any action of the step.

  • Match against an element – Validate that the text is present in a single, specified element of the step. If you select this validation mode, you must define the target window and the element locators. The Target Window field and the Locators area are only displayed if this mode is selected.

You can use evaluation syntax for the Match Text field.

There are also two validation options:

  • Fail the script if the text matches the Match Text in the specified mode.

  • Interpret the specified text string as a regular expression.

Validate settings

If you need to validate against multiple criteria, create one Validate action for each criterion. The script will only continue if all Validate actions are successful.

Change a Validate action

  1. Select a Validate action in the interactive timeline.

  2. Click located below the interactive timeline to show the action settings.

  3. Select the criteria for the validation.