Validations are the technique used to verify that a test event occurs as expected. For example, text on a web site landing page after login or in a WebUI or mobile app after a view is loaded.
- For browser and app actions, out-of-the-box validations can be added Clip Editor, List View (when an action is expanded) or via the lower panel wheever a given action is open in the Action Editor.
- For message validation, refer to User Defined Validations instead.
Out-of-the-box action validations range from simple true/false conditions such as
verifyAlertNotPresent, which verifies that the action did not cause an alert to appear, to more complex conditions such as
verifyTableCellText which verifies that a particular cell in a given table contains the specified text. A single message, browser action, or app action can have an unlimited number of validations.
For a complete reference to App Actions, refer to the TouchTest Advanced Tutorial, App Action Reference section.
Message and action validations consist of the selected command, the parameters of the selected command such as pattern matching, where applicable, and a failure action (represented by the "Errors should" field), as well as log messages that can optionally be customized.
Adding a Validation to an Action
- In the Expanded view, use the mouse to hover over the clip element.
- 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.
- 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.
- Where required, enter a locator. You can copy and paste a Locator from the Input field of a given action.
- Select a Failure Action from the Errors should: drop-down
The 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.
- 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.
Some validations have additional fields, such as the Property field shown above for
- 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.
Validations are the technique used to verify that a test event occurs as expected. For example, you can validate the text that you expect to appear in a mobile app after a given view is loaded.
- If a Locator has been specified for a validation then the Property icon is active. You can combine locators with expressions selected from among the available property values using the ISSE Editor.
- For those validations that take a locator, you can also use the Locator icon to enter Touch Locator mode and change the selection. Note that the Locator icon is only active while in record mode.
- Refer to Touch Locator for Mobile Apps for the steps to enter Locator mode on the target device.