Skip to content

Menu

flaui.core.automation_elements.Menu

Bases: AutomationElement

Class to interact with a menu or menubar element

is_win_menu property writable

Flag to indicate if the containing menu is a Win32 menu because that one needs special handling

Returns:

Type Description
bool

True if the menu is Win32 model, else False

items property

Gets all MenuItem which are inside this element.

Returns:

Type Description
List[MenuItem]

List of Menu Items

get_item_by_name(name)

Gets the menu item by name.

Parameters:

Name Type Description Default
name str

Name of the menu item

required

Returns:

Type Description
MenuItem

MenuItem element

Source code in flaui/core/automation_elements.py
@handle_csharp_exceptions
def get_item_by_name(self, name: str) -> MenuItem:
    """Gets the menu item by name.

    :param name: Name of the menu item
    :return: MenuItem element
    """
    return MenuItem(raw_element=self.raw_element.Items[name])