Select Menu Item

Selects the item at the given path in an application's menu bar or ribbon by opening the menus in turn. Works on Windows and SAP elements; throws an error on browser and Java elements. By default, Element uses the element found by the Get Element activity.


⬅️INPUT

Parameter

Type

Required

Description

Element

IElement

✅ Yes

The element that contains the menu. On Windows, it can be the menu bar, the ribbon, an item inside them or the surrounding window; if the window is minimized, it is restored first. Elements selected with Vision are not supported. If empty (null), the activity throws an error.

SelectedValue

String

✅ Yes

Menu path of the item to select; levels are separated by / (e.g. File/Save As). Case, access keys and shortcut texts are ignored. If an item on the path cannot be found, the activity throws an error.

Timeout

TimeSpan

❌ No

On Windows, the total time to wait for the items on the path to appear; if left empty, 30 seconds. On SAP, the maximum time to wait for the command to complete; if left empty, 1 day.


Usage

If the activity is inside an activity with a selector (e.g. Get Element), the Get Selectable Items button on the canvas reads the menu of the application found by that parent activity. While reading, only submenus are opened; menu commands are not run.

  • Then an item is selected from the menu opened by the Choose an item button; its path is written to the Selected Value field. The field can also be filled manually or with a variable.

  • When Traverse All Submenus is on, all submenus are also opened and listed; when it is off, only the top-level menus are opened. Opening all submenus takes longer: no new menu is opened after 2 minutes, at most 5000 items are listed, and a warning is shown if the list is incomplete.

  • Traverse All Submenus has no effect while the workflow is running; at run time, only the menus on the selected path are opened.