Skip to main content

ListBoxElement

Playwright element wrapper for <vaadin-list-box> supporting single and multiple selection, item-level enablement, and label-based lookup.

Component Tag

vaadin-list-box
  • vaadin-item - List box item element

Implements

  • HasAriaLabelElement - ARIA label support
  • HasStyleElement - CSS class and style management
  • HasTooltipElement - Tooltip text
  • HasEnabledElement - Enable/disable state

Constructor

Locator
required
Playwright locator for the <vaadin-list-box> element

Static Factory Methods

getByLabel

Get a list box by its accessible label.
Page
Playwright page
String
List box’s accessible label (ARIA role: LISTBOX)

Methods

selectItem

Select an item based on its text. In multiple mode, toggles selection state.
String
Visible label of the item

getSingleSelectedValue

Get the selected value for single-select list boxes.
Returns the text content of the selected item.

getSelectedValue

Get all selected values for multi-select list boxes.
Returns a list of text contents for all selected items.

isMultiple

Whether the list box is in multiple selection mode.

Assertion Methods

assertSelectedValue

Assert that the selected values match the expected labels.
String...
Expected selected item labels

assertItemEnabled

Assert that a specific item is enabled.
String
Item label

assertItemDisabled

Assert that a specific item is disabled.
String
Item label

assertMultiple

Assert that multiple selection is enabled.

assertSingle

Assert that single selection mode is enabled.

Usage Examples

Basic Selection

Single Selection Mode

Multiple Selection Mode

Check Item State

ARIA Label

Tooltip

CSS Class