Recorder variables are variables which are defined within the action table of the recorder view. Typically, these variables represent key sequences, match values, match names, file names, or file arguments, working directories, or any other parameter which is given along with the starting of an application under test. Any constant value which can be defined as a variable within the action table of the recorder represents this type of variable.
In this chapter
Before replacing a constant value with a variable, it is necessary to identify possible and useful variable candidates. Assume a database form where person data are to be inserted.
Important to know:
- In this example, the text constant values for the first name, last name, and age can be replaced by a recorder variable
- Variables in Ranorex are identified by a preceding
$to the variable name
- Naming conventions and the management of variables are in control of your test team
Defining recorder variables
Select the action where a recorder variable is to be defined and open the drop-down list right from the constant value. Click As new variable… to start variable definition
Assign the variable a meaningful name and confirm with OK
See the green printed variable name replacing the former constant value
Default variable value
The initially set (i.e. recorded) value is automatically pre-set as default variable value. In our example, the initially recorded text value ‘John’ is therefore set as default value. Default values can be changed at will.
The default value is the value which is applied if the variable is not bound to any data. Therefore, it might be important to choose the default value with care.
Action variable management
Action variables can be managed by means of the variable editor which is to be opened by clicking Variables in the recorder view.
Select & open a recording module containing variables
Click the Variables… button in recorder toolbar to open the variable editor
Only variables of the current recording module are displayed in the variable editor.
Variable name(s) with corresponding default value(s)
Variable editor toolbar
- Menu to copy & paste a variable to / from the clipboard
- Option to add a new variable directly
- Option to remove unused variables (variable cleanup)
- Option to copy a variable from the repository to the current recording module if existent
- Variable in use: Variable is used, i.e. it is assigned to an action item
- Variable in use from repository: Variables from the repository show up if a variable repository item is used by the recording
- Variable not in use: Variable is defined, but not assigned to an action item