Skip to main content

RadioButtonGroupElement

Playwright element wrapper for <vaadin-radio-group>. Provides helpers to select by label/value and assert selected state.

Component Tag

vaadin-radio-group

Implements

  • HasLabelElement
  • HasEnabledElement
  • HasHelperElement
  • HasValidationPropertiesElement

Factory Methods

getByLabel

Get the radio button group by its accessible label. Uses ARIA role RADIOGROUP.
Page
required
The Playwright page
String
required
The accessible label of the radio group
Returns: The matching RadioButtonGroupElement

Constructor

RadioButtonGroupElement

Create a new RadioButtonGroupElement.
Locator
required
The locator for the <vaadin-radio-group> element

Methods

selectByLabel

Select a radio button by its label text.
String
required
The label text of the radio button to select

selectByValue

Select a radio button by its value.
String
required
The value of the radio button to select

getRadioButtonByLabel

Get a specific radio button by its label within the group.
String
required
The label text of the radio button
Returns: The matching RadioButtonElement

setValue

Set the selected value by label.
String
required
The label of the radio button to select

assertValue

Assert the selected value by label.
String
Expected label of the selected radio button, or null/empty for no selection

Usage Examples

Basic Selection

Pre-selected Value

Disabled State

Helper Text