Recorder Variables

As described in lesson 3 a recording can have variables instead of static string values generated during the recording session. Especially key sequence actions used to type in for example 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 have variables instead.
Variables used for different types of action items
Variables used for different types of action items

The variables shown in the table above are written in green font. All variables used within the recording can be connected to a Ranorex data connector or to simple 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 the lesson 'Data Driven Testing' you learned how to create variables directly within the actions table.

Create a new variable for a key sequence action item
Create a new variable for a key sequence action item
Create a new variable
Create a new variable
Though there are not only key sequences which might use a variable. To make a click action data driven - for example selecting the radio button Male or Female - you need to define a repository varialbe used for identification within a RanoreXPath expression. Select the context menu item 'Make Item Variable ...' to create a new repository variable to have a data driven mouse click action.
Make click action variable
Make click action variable
Create a new variable for selecting a radio button
Create a new variable for selecting a radio button
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'.
Variable dialog of a recording used to create and edit variables
Opens the 'Variables' dialog
Variable dialog of a recording

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 into the cells of the table. Press the 'Copy Variable from Repository' button at the tool bar to make variables defined at the given repository available for the recording. Read more about variables specified in repositories here.