Concept of validation
Test validation is based on a process with four consecutive steps. Once entered, the steps are automatically performed one after the other. Usually, the process is started from within a test recording. In this case, the recording is automatically paused until the validation process has been finished and automatically resumes afterward. The process anyway, is also valid if applied manually.
In this chapter
Depending on the type of validation (i.e. attribute-based, or image-based validation) the process steps vary in their specification and setting, but they are always the same with respect to their objectives.
The purpose of this chapter is to introduce and explain them.
Test validation standard process
Within Ranorex, validation is treated as a special type of action. Therefore, ‘activating’ the test validation means inserting a validation action into the current test case. The herein described activation steps refer to the insertion of a test validation during a recording. Validation actions, of course, can also be added manually which is described and introduced in the referring user guide chapter.
Test validation activation
- Click Validate to activate text-based validation mode
- Select the checkbox Image based
- Click Validate to activate image-based validation mode
The recording is paused during the definition and specification of a test validation. This is indicated by the green Recorder control center.
Specifying the validation element
The second step of the validation process is the specification of the validation element. Specifying the validation element means identification of the UI-element which is to be validated. The specification process is independent of the type of validation (i.e. text/attribute/image-based validation).
- A pink colored frame follows the mouse movement
- It identifies UI-elements along the mouse movement
Selection of validation elements
- The identification of validation UI-element may be tricky. Especially if the referring UI-element is nested closely with other UI-elements. Take your time, there is no need for hurry.
- If you have selected the wrong UI-element by mistake, no problem! You can change it during the next step.
Confirmation of validation element
The third step of the validation process is the confirmation of the previously selected validation UI-element. This step outlines two objectives:
- Check if the correct UI-element has been selected in the previous process step and confirm the selection.
- Correct the identification of the validation UI-element if necessary and then confirm the selection.
Confirmation dialog components
Components of validation confirmation dialog
- Ranorex identifies every UI-element within the application under test.
- All UI-elements are managed in a hierarchical tree-like storage structure.
- The names of the UI-elements are retrieved from their underlying type and content.
- Every UI-element is defined by a set of attributes and states
- An example of a state is ‘Enabled’ with a current value of ‘True’
- An example of an attribute is the UI-elements name, i.e. a text-attribute with the current value ‘lblWelcomeMessage’
- A screenshot of the selected UI-element is displayed for a quick check & confirmation
UI-elements, their representation within Ranorex and their states and attributes are introduced and explained within the advanced chapter > Ranorex Studio advanced > UI-elements > ⇢ Introduction
Click Next to confirm validation element
Defining validation attributes
Every UI-element is defined by states and attributes. During the final step, the attribute or state which is applied for the test validation is to be specified. Therefore, a dialog is displayed to specify the necessary settings.
Attribute / sub-image selection for validation UI-elements
- Any of the available attributes/states can be selected
- The text attribute is the default attribute for text-based validation
- Select attribute and confirm with OK
- A sub-region of the image can be selected by drawing a pink rectangle within the image.
- If you do not select a sub-region, the complete image is used for test validation
- None = No image-based validation; validation discarded
- Contains = Matched image is checked to be contained in the reference validation image
- Compare = Matched image is checked against complete reference validation image
The herein introduced concept of validation is explained along some examples which may help you to deepen your understanding of this important topic.
The current section refers to some further and more advanced topics which are listed herein after.
UI-elements, their representation and management within Ranorex and their attributes and states are introduced and explained in detail in > Ranorex Studio advanced > UI-elements > ⇢ Introduction