These are accessed by calling
RadioCollection is accomplished with
Browser#radios, but you should
always prefer working with a
For all of the different ways of locating a
take a look at our Locating Elements Guide.
RadioSet is located by passing in a valid locator for any
Radio elements included in the
RadioSet (so often using the
:name attribute locator).
Radio Buttons are special because only one button within a form with a specific name can be selected at a time. You can either identify the specific Radio button you want and interact with it, or you can identify the entire group with RadioSet and select the one you want by value or text.
They also inherit methods from standard Web Elements
Common or Special Methods
Standard Setter Interface
This functionality was added in Watir 7 beta 2.
Radio#set is the same behavior as the superclass
Element; if no arguments are passed
true is passed, it will click the link.
RadioSet#set is an alias of
#select. It takes a
String or a
Watir will select the first
Radio that matches by