Radio Buttons

Radio Buttons

Watir sets or clears radio list items by looking at the attributes available in the <input type="radio"> HTML tag. Common attributes are id and name. For complete list see HTML Elements Supported by Watir.

What you see in the web browser:

Click Me:

This is the tag in the HTML source:

<input type="radio" name="clickme" id="one">

id Attribute

Watir code to set a radio list item using the and id attribute:

ie.radio(:id, "one").set

Watir code to clear a radio list item using the id attribute:

ie.radio(:id, "one").clear

name Attribute

Watir code to set a radio list item using the name attribute:

ie.radio(:name, "clickme").set

Watir code to clear a radio list item using the name attribute:

ie.radio(:name, "clickme").clear
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.