Validation

This Documentation is only for Ranorex 2.x versions.

Click here for the Ranorex 3.x test automation documentation

The Ranorex Recorder provides two different types of validation during a running recording session.

Validating States or Properties During Recording

The Ranorex Recorder tool bar can be used to validate states or properties of GUI elements during a running recording session. Click the 'Validate' button to pause the recording.

Validation mode is active

Recording is now paused. Move your mouse pointer over a specific GUI element. Wait a moment to ensure that the text box is tracked and ready to be validated. Click it to open the validation dialog.

The frame specifies the element to validate
The dialog shows the available attributes to check
The recorded validation is listed as a separate validation action item within the recorder's actions table. Open the properties of the validation item and change the value for the attribute 'Exception on Fail' to false, to prevent the Recorder from stopping the replay if there is a failed validation.
Recorded validation item with properties
Replay result with warning that validation failed

The type of a validation can be specified during a recording session or changed after finishing the recording using the property grid for a validation action item within the Ranorex Recorder.

Validation Types

 

Exists

Checks the existence of the associated repository item

NotExists

Checks for non-existence of the associated repository item

AttributeEqual

Compares the specified attribute value of the associated repository item with the given value
AttributeRegEx Compares the specified attribute value of the associated repository item with the given regular expression
ContainsImageValidates the existence of the given image within the associated repository item.

CompareImage

Validates the existence of the given image at a specifi position within the associated repository item 

To validate UI elements of pop-up windows like menus, use the shortcut key 'V' to turn on validation mode without clicking the 'Validate' button. Read more about how to enable the recorder's hot keys here.

Validation of menu items

Validating Images during Recording

In addition to validating attribute values of a UI element, it is also possible to validate images or screen regions of an application. Simply switch to validation mode as described above and select a UI element. To validate the element's image, open the 'Image' tab in the validation dialog.
Validate the existence of an image region within the screenshot of Windows start button

Select the option 'Contains' to check whether the selected image region is found anywhere within the UI element screenshot or not. In comparison to 'Contains',  the 'Compare' option is used to find the image exactly at the specified position.

If you need to change the recorded image validation action afterwards, simply open the 'Edit Image Validation' dialog using the context menu item 'Edit Image...".
Open image validation editor
To alter the settings of an image based validation, open the property 'Image-Based Location' found within property grid.

Image-Based Location settings
 

Advanced Options

Use the property group to set advanced image search options like 'Clipping' or 'Best Match'

Preprocessing

Defines preprocessing steps that can be performed on an image before search (e.g. GrayScale or DownSize)

Screenshot Name

Specifies the name of the screenshot to search for.
Selection Rectangle Defines the image selection region;i.e. what to search for
SimilaritySpecifies the minimum similarity that the image region to search for needs to have in common the image in order to be considered a match