In this article, you’ll learn how to add actions, configure them in the actions table, and manage them manually.
Add a new action
Many actions are generated automatically during recording. However, some actions must be added manually.
There are two ways to add an action manually:
- Using a menu option
- Dragging and dropping a repository item to the actions table
Add an action from a menu
- In the actions table toolbar, click Add new action.
- You can also right-click the actions table and select Add new action from the context menu.
- Choose the desired action type from the list. The new action is inserted at the position of the selected row in the actions table.
Drag and drop a repository item to the actions table
- In the repository, select the repository item you want to use.
- Drag the item to the actions table and drop it at the desired position.
- A context menu opens with all possible actions for this repository item. Click the desired action.
Configure actions
The actions table is where you configure your actions. You can change settings through an action’s components, its context menu, and its properties. Some of these options overlap.
Action components
The action table contains seven different columns. These columns represent the five different components of an action.
The components are grouped as follows:
- Action symbol and sequence number: Each action has an icon that represents its type. The sequence number tells you the order in which actions are executed.
- Action type: The action type indicates what the action does or which part of a UI device it manipulates.
-
Action specifics: The contents of columns 3–5 change depending on the action type. They define what the action does in detail, for example:
- The exact text string of a key sequence
- The type of mouse click
- The delay duration
- Repository item: The repository item the action is performed on, i.e. the target of the action. Repository items represent UI elements in the AUT and are managed separately from actions, but they are linked to each other.
- Comment: A free-text comment to document what an action does. This does not affect the action itself.
Action screenshots
When you use the Ranorex Recorder to record an action that targets a UI element, Ranorex automatically saves a screenshot for that action.
You can view this screenshot next to the actions table. Click Screenshot to show or hide it.
An action’s context menu gives you quick access to several settings. Some options are only available for certain actions. You can also select several actions at once to apply context-menu settings to all of them. Different settings are available when more than one action is selected.
Single-action settings
- Highlight element: Highlights the linked repository item in the AUT. The AUT must be running. Only available for actions linked to a repository item.
- Add new action: Adds a new action after the current action.
- Make repository item variable…: Makes the linked repository item a variable. Only available for actions linked to a repository item.
- Set search timeout…: Defines how long Ranorex will attempt to find the linked repository item before the action fails. Only available for actions linked to a repository item.
-
Enable/Disable continue on fail: Sets whether Ranorex will progress to the next action or abort the test if this one fails.
- When disabled (default), test execution stops when this action fails.
- When enabled, test execution continues with the next action even if this one fails.
If this option is enabled, the affected action appears in italics in the actions table.
- Enable/Disable: Sets whether the action will be run or skipped during test execution. Enabled actions are executed as normal. Disabled actions are grayed out in the actions table and are not executed.
- View code: Displays the underlying code of the action in the code editor. This is useful for expert configurations and for working with user code actions.
- Convert to user code: Converts the action to a user code action.
- Move to new recording module: Creates a new recording module containing the selected action and moves the action into it.
- Cut / Copy / Paste / Delete: Cuts, copies, pastes, or deletes the selected action.
- Properties: Opens the action’s properties panel, which is explained in more detail below.
Multiple-action settings
Merge items to user code item: Merges the code of the selected actions into a single user code action. This is useful for combining several actions into one block for advanced scenarios.
Merge selected keyboard items: When two or more Key sequence or Key shortcut actions are linked to the same repository item, you can merge them to combine the key presses into a single action. This is useful for combining keyboard input that was unintentionally split up into several actions.
Properties
Action properties are the options you use to control the behavior of actions. There are two groups of action properties:
- Standard properties: Apply to most action types and are explained below.
- Action-specific properties: Apply only to particular action types.
Action-specific properties are described along with their associated actions in Action properties.
There are two ways to access an action’s properties:
- Right-click an action and click Properties.
- Click an action and press
F4
These also work for multiple actions. The properties panel will then display all properties shared among the selected actions.
Standard properties
The following list explains all standard properties and their behavior. They can be configured for almost all action types. Default values appear in bold.
-
Comment
Possible values: empty or text.
Adds a comment. It can also be set directly in the action table.Available for all actions except the Separator action
-
Continue on fail
Possible values: false or true
- If set to false, test execution stops when this action fails.
- If set to true, test execution continues with the next action when this action fails. -
Duration
Possible values: time in milliseconds (default varies by action)
Defined action duration
Available for all actions except the Report and Separator actions -
Enabled
Possible values: true or false
Enables or disables the action. You can also select an action and press Ctrl + E to enable or disable it. -
Repository item
Possible values: A reference to a repository item
The repository item the action is linked to.
Available for all actions that can be linked to repository items. -
Use logging
Possible values: Default, true, or false
Sets whether the action will be logged to the report or not.
When set to Default, this value is inherited from the Use item logging by default setting in the Recorder defaults, where it is enabled by default. Therefore, all actions are logged by default.
Available for all actions except the Separator action, which is always logged.