Class RadioButton
java.lang.Object
net.serenitybdd.screenplay.playwright.ui.RadioButton
Factory for locating radio button elements using Playwright selectors.
Uses Playwright's role selectors for accessibility-aware radio button location.
Sample usage:
Target yesOption = RadioButton.withLabel("Yes");
Target genderMale = RadioButton.withNameOrId("gender-male");
Target optionB = RadioButton.withValue("option-b");
-
Method Summary
Modifier and TypeMethodDescriptionstatic TargetLocate a radio button using a custom Playwright selector.static TargetLocate a radio button by its label text (case-insensitive).static TargetwithNameOrId(String name) Locate a radio button by its name attribute, id, or data-test attribute.static TargetLocate a radio button by its value attribute.
-
Method Details
-
withLabel
Locate a radio button by its label text (case-insensitive). Uses Playwright's role selector for semantic radio matching.- Parameters:
label- The radio button's label or accessible name- Returns:
- A Target for the radio button element
-
withNameOrId
Locate a radio button by its name attribute, id, or data-test attribute.- Parameters:
name- The name, id, or data-test value- Returns:
- A Target for the radio button element
-
withValue
Locate a radio button by its value attribute.- Parameters:
value- The value attribute- Returns:
- A Target for the radio button element
-
locatedBy
Locate a radio button using a custom Playwright selector.- Parameters:
selector- A valid Playwright selector- Returns:
- A Target for the radio button element
-