Manage actions

In this chapter, you’ll learn to manually add actions, configure actions, and manage them.

In this chapter

    tipp icon

    Screencast

    The screencast “Manage actions” walks you through information found in this chapter.

    Watch the screencast now

    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 – 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

    Add new action by repository item

    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.

    Note icon

    Note

    The new action is automatically linked to the repository item.

    Configure actions

    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.

    Action components

    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 components

    Action components

    Action symbol and sequence number

    • Each action has its own symbol.
    • 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 or the type of mouse click.

    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.
    • Repository items are managed separately from actions, but they are linked to each other.

    Further reading

    Repositories and repository items are introduced in Ranorex Studio fundamentals > ⇢ Repository.

    Comment

    • Here you can add comments to document what an action does. This has no effect on the action itself.

    Action screenshots

    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

    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

    Context menu with all available options

    Note icon

    Note

    The first four items are called run options. They are explained in Ranorex Studio Fundamentals > Ranorex Recorder > ⇢ Run and debug recordings.

    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 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 continue on fail: Sets whether Ranorex will progress to the next action or abort the test if this one fails. The default setting is disabled. If this option is enabled, the affected action will appear in italics in the actions table.

    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.

    Multiple-action settings

    Context menu for multiple-action settings

    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 useful for combining keyboard input that was unintentionally split up into several actions.

    Properties

    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.

    Reference

    Action-specific properties are described along with their associated actions in Ranorex Studio Fundamentals > Actions > ⇢ 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.

    One way of accessing an action's properties

    One way of accessing an action’s properties

    Standard 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

    Standard action properties

    Comment

    • 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.

    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.