Skip to content

RadioButtonElement

Full API (methods, signatures, descriptions): see api-reference.md. This note covers only behaviour that isn't obvious from the signatures.

Package-private — use through RadioButtonGroupElement

RadioButtonElement is package-private and intended for internal use by RadioButtonGroupElement; its factory is package-private too, and the checked-state methods it inherits from HasCheckedElement are only reachable from inside the package. Drive radio buttons through the group rather than constructing them directly.

RadioButtonGroupElement group = RadioButtonGroupElement.getByLabel(page, "Gender");
group.selectByLabel("Male");

RadioButtonElement maleRadio = group.getRadioButtonByLabel("Male");
maleRadio.assertChecked();