Skip to main content

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:
  • HasThemeElement
  • HasStyleElement
  • HasAriaLabelElement

Constructors

Create a MenuElement from the page by locating the first <vaadin-menu-bar-list-box> element.
Page
required
The Playwright page instance
Create a MenuElement from an existing locator.
Locator
required
The Playwright locator for the menu overlay element

Methods

getMenuItemElement(String name)

Get a menu item by its visible label within this menu overlay.
String
required
The visible label text of the menu item
Returns: 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.
String
required
The visible label text of the menu item that contains a submenu
Returns: MenuElement - The opened nested submenu overlay

Static Factory Methods

getByLabel(Page page, String label)

Get a menu overlay by its accessible label (ARIA label).
Page
required
The Playwright page instance
String
required
The accessible label of the menu overlay (uses ARIA role MENU)
Returns: MenuElement - The menu overlay with the specified label

Usage Example