Skip to main content

MultiSelectComboBoxElement

Playwright element wrapper for <vaadin-multi-select-combo-box>. Provides helpers to open the overlay, filter items, select/deselect multiple items, and query selected chips.

Component Tag

vaadin-multi-select-combo-box

Implements

  • FocusableElement
  • HasAriaLabelElement
  • HasInputFieldElement
  • HasThemeElement
  • HasPlaceholderElement
  • HasEnabledElement
  • HasTooltipElement
  • HasValidationPropertiesElement
  • HasClearButtonElement
  • HasAllowedCharPatternElement

Factory Methods

getByLabel (Page)

Get the MultiSelectComboBoxElement by its label. Uses ARIA role COMBOBOX.
Page
required
The Playwright page
String
required
The accessible label of the field
Returns: The matching MultiSelectComboBoxElement

getByLabel (Locator)

Get the MultiSelectComboBoxElement by its label within a given scope.
Locator
required
The locator to search within
String
required
The accessible label of the field
Returns: The matching MultiSelectComboBoxElement

Constructor

MultiSelectComboBoxElement

Create a new MultiSelectComboBoxElement.
Locator
required
The locator for the <vaadin-multi-select-combo-box> element

Selection Methods

selectItem

Select an item by its visible label. Opens the overlay and clicks the matching item (toggling its selection).
String
required
Label of the item to select

deselectItem

Deselect an item by its visible label. Opens the overlay and clicks the matching item (toggling its selection off).
String
required
Label of the item to deselect

selectItems

Select multiple items in sequence.
String...
required
Labels of the items to select

deselectItems

Deselect multiple items in sequence.
String...
required
Labels of the items to deselect

filterAndSelectItem

Type filter text into the input, then click the matching item.
String
required
Text to type for filtering
String
required
Label of the item to select

Filter Methods

setFilter

Type into the input to trigger filtering. Uses pressSequentially to fire keyboard events that the component listens to for filtering.
String
required
The filter text

getFilter

Get the current filter value from the DOM property. Returns: The current filter string

Open/Close Methods

open

Open the combo box overlay.

close

Close the combo box overlay.

isOpened

Check whether the overlay is currently open. Returns: true when the overlay is open

assertOpened

Assert that the combo box overlay is open.

assertClosed

Assert that the combo box overlay is closed.

Value Methods

getValue

Get the selected values as a comma-separated string from the selectedItems property. Returns: Comma-separated selected values, or empty string when nothing is selected

assertValue

Assert that the displayed value equals the expected string.
String
Expected comma-separated value or empty string for no selection

Read-Only Methods

isReadOnly

Check whether the combo box is read-only. Returns: true when read-only

assertReadOnly

Assert that the combo box is read-only.

assertNotReadOnly

Assert that the combo box is not read-only.

Toggle Button Methods

getToggleButtonLocator

Get locator for the toggle button part. Returns: Locator for the toggle button

clickToggleButton

Click the dropdown toggle button.

Overlay Item Methods

getOverlayItemCount

Count visible overlay items. Returns: The number of visible items

assertItemCount

Assert that the overlay contains exactly the expected number of items.
int
required
Expected item count

Chip Methods

getChipLocators

Get the locator for all non-overflow chips. Returns: Locator for selected-value chips

getOverflowChipLocator

Get the locator for the overflow chip. Returns: Locator for the overflow chip

getSelectedItems

Get the labels of all currently selected items by reading the selectedItems property from the web component. Returns: List of selected item labels

getSelectedItemCount

Get the count of currently selected items from the selectedItems property. Returns: Number of selected items

assertSelectedItems

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

assertSelectedCount

Assert that the number of selected items matches.
int
required
Expected number of selected items

Component Query Methods

getOverlayItemComponent (by text)

Get a typed component element from an overlay item matching the given text. The component class must be annotated with @PlaywrightElement and have a public constructor accepting a single Locator parameter.
String
required
Text of the overlay item to search in
Class<T>
required
The element class (e.g., ButtonElement.class)
Returns: The first matching component inside the item

getOverlayItemComponent (by index)

Get a typed component element from an overlay item at the given visible index. The component class must be annotated with @PlaywrightElement and have a public constructor accepting a single Locator parameter.
int
required
0-based visible item index
Class<T>
required
The element class (e.g., ButtonElement.class)
Returns: The first matching component inside the item

Locator Methods

getFocusLocator

Get the locator to use for focus operations. Returns: The input locator

getAriaLabelLocator

Get the locator for ARIA label. Returns: The input locator

getEnabledLocator

Get the locator to use for enabled/disabled checks. Returns: The input locator

Usage Examples

Basic Multi-Selection

Deselection

Filter and Select

Clear Selection

Verify Selected Items

Lazy Loading

Custom Renderer with Components

Read-Only State

Validation