Overview
MenuElement is a Playwright wrapper for the menu overlay list <vaadin-menu-bar-list-box>. It represents submenu overlays that appear when menu items are clicked.
Component tag: vaadin-menu-bar-list-box
Implements:
HasThemeElementHasStyleElementHasAriaLabelElement
Constructors
MenuElement(Page page)
Create aMenuElement from the page by locating the first <vaadin-menu-bar-list-box> element.
The Playwright page instance
MenuElement(Locator locator)
Create aMenuElement from an existing locator.
The Playwright locator for the menu overlay element
Methods
getMenuItemElement(String name)
Get a menu item by its visible label within this menu overlay.The visible label text of the menu item
MenuItemElement - The menu item element with the specified label
openSubMenu(String name)
Click a menu item to open its submenu and return the next overlay.The visible label text of the menu item that contains a submenu
MenuElement - The opened nested submenu overlay
Static Factory Methods
getByLabel(Page page, String label)
Get a menu overlay by its accessible label (ARIA label).The Playwright page instance
The accessible label of the menu overlay (uses ARIA role MENU)
MenuElement - The menu overlay with the specified label
Usage Example
Related Elements
- MenuBarElement - Top-level menu bar
- MenuItemElement - Individual menu items