In this chapter, you’ll learn to manually add actions, configure actions, and manage them.
In this chapter
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: by using a menu option or by dragging and dropping a repository item to the actions table.
Add an action from a menu
Add new action – menus
Add new action menu in the actions table toolbar.
Add new action menu option in the actions table context menu.
Drag and drop a repository item to the actions table
Select a repository item and drop it in the actions table.
A context menu opens with all possible actions for this repository item. Click the desired action.
The new action is automatically linked to the repository item.
The actions table is where you configure your actions. You can enter different settings through an action’s components, its context menu, and its properties, some of which overlap.
The action table contains seven different columns. These columns represent the five different components of an action. Some actions have fewer components, others more. The components are grouped as follows:
Action symbol and sequence number
- Each action has its own symbol.
- The sequence number tells you the order in which actions are executed.
- The action type indicates what the action does or which part of a UI device it manipulates.
- 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 or the type of mouse click.
- The repository item the action is performed on, i.e. the target of the action.
- Repository items represent UI elements in the AUT.
- Repository items are managed separately from actions, but they are linked to each other.
Repositories and repository items are introduced in Ranorex Studio fundamentals > ⇢ Repository.
- Here you can add comments to document what an action does. This has no effect on the action itself.
When you use the Ranorex Recorder to record an action that targets a UI element, a screenshot will be saved of the action. You can view this screenshot next to the action table. Click Screenshot to view or hide it.
Turning screenshots on/off
Context menu settings
An action’s context menu gives you quick access to several settings, some of which are only available for certain actions. You can also select several actions at once to apply context-menu settings to them. Different settings are available when more than one action is selected.
Context menu with all available options
The first four items are called run options. They are explained in Ranorex Studio Fundamentals > Ranorex Recorder > ⇢ Run and debug recordings.
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 for 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: Sets whether the action will be run or skipped during test execution. The default setting is enabled. Disabled actions are grayed out in the actions table.
View code: Displays the underlying code of the action in the code editor. Useful for expert configurations and ⇢ 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.
Cut/Copy/Paste/Delete: cuts, copies, pastes, or deletes the selected action.
Properties: Opens the action’s properties, which are explained later in this chapter.
Context menu for multiple-action settings
Merge items to user code item: Merges the code of the actions to a single ⇢ user code action. Useful for combining several actions for advanced scenarios.
Merge selected keyboard items: When two or more Key sequence actions 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 u
Action properties are the various options with which you can control the behavior of actions. There are two groups of action properties: Standard properties and action-specific properties. Standard properties define behavior that applies to most action types and are explained below. Action-specific properties define behavior that applies only to particular action types.
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.
One way of accessing an action’s properties
Here you’ll find a list of all standard properties and details about them. They can be configured for almost all action types. Default values appear in bold.
Standard action properties
- Possible values: empty or text.
- Adds a comment. 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.
- Possible values: time in milliseconds (default varies by action)
- Defined action duration
- Available for all actions except the Report and Separator actions
- 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.
- Available for all actions except the Separator action.
- 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.
- 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
defaultsetting 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.