Ranorex Help Center

How can we help you?

Recorder Variables

As described in Lesson 3: Data-Driven Testing a recording can have variables instead of static string values generated during the recording session. In particular key sequence actions used to type in such things as log-in data into a form are commonly used action items which have to be data driven in many cases. At any position within the actions table where you can change or set values in a cell it is possible to use variables instead.
Variables used for key sequence actions

Variables used for key sequence actions

The variables in the table above are shown in green. All variables used within the recording can be connected to a Ranorex data connector or to local/global parameters provided by the the entire test suite or a single test case.

Creating Variables

There are different ways to create new variables for a recording. During Lesson 3: Data-Driven Testing you learned how to create variables directly within the actions table.

Make a key sequence action variable

Make a key sequence action variable


Create a new variable

Create a new variable

Most action types can make use of variables. To make a click action data driven - for example selecting an icon for password entry - you need to define a repository variable used for identification within a RanoreXPath expression. Select the context menu item 'Make Item Variable...' to create a new repository variable in order to have a data driven mouse click action.

 
Creating a new variable for use within the path of the repository item

Creating a new variable for use within the path of the repository item

Create a new variable for selecting a menu item

Create a new variable for selecting a menu item

Another option is to open the variables dialog where you can add new or change existing variables already used by the recording. Moreover, you can see which variables are 'In use', 'Not in use' or 'In use from Repository'.
Open the variables dialog in the Recorder

Open the variables dialog in the Recorder

Variable dialog of a recording with different levels of usage

Variable dialog of a recording with different levels of usage

Use the toolbar to add, remove or copy a variable from the repository. Change the name of the variable and set a default value by clicking in the cells of the table. Press the 'Copy Variable from Repository' button in the tool bar to make variables defined in the given repository available for the recording. Read more about variables specified in repositories in Lesson 3: Data-Driven Testing - Using Variables within the Repository.