This chapter uses a simple example to explain the concept of text-based validation. Before working with this example, make sure you’re familiar with the ⇢ basic concept of test validation.
In this chapter
To follow along with the steps in this chapter, download the sample solution file from the link below.
Theme: Text-based validation
Time: Less than 30 min
Unzip to any folder on your computer.
Start Ranorex Studio and open the solution file Introduction.rxsln
Before we start recording our test, let’s define it. The test consists of 5 steps:
1. Open the Ranorex Demo Application.
2. In the “Enter your name” field, enter Harry and click Submit.
3. Verify that the welcome message changes accordingly.
4. Reset the welcome message.
5. End the demo application and stop the recording.
The purpose of the test validation in this example is to verify whether the interaction in step #2 of our test definition leads to the desired result, i.e. if the welcome message changes accordingly. Since this requires us to validate the text contained in a text field, we’re carrying out a text-based validation.
Let’s go through the steps:
Click Validate. Recording pauses and the Recorder switches to validation mode.
Select the UI element to validate:
To confirm the UI element, click Next.
UI element location within GUI
UI element states and attributes
Screenshot of validation UI element
The attribute Text is usually preselected. If it isn’t, select it. Click OK to confirm.
Text is selected as validation attribute.
Other attributes available for validation.
The finished recording contains five actions. Action #4 is the validation action.
Validation type operator
A detailed description of all validation type operators can be found in Ranorex Studio fundamentals > Actions > ⇢ Action properties.
The linked repository item
Spelled out, the validation reads as follows:
Text attribute of the UI element referenced by
LblWelcomeMessage is equal (
AttributeEqual) to “Welcome, Harry!“, THEN the validation returns the value