Dashboard > Watir > ... > Simple > Radio Buttons
Watir Log In View a printable version of the current page.
Radio Buttons
Added by Zeljko, last edited by Zeljko on Feb 14, 2008  (view change) show comment
Labels: 
(None)

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 Methods Supported by Element.

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
Go to contents, previous, next page.

Site running on a free Atlassian Confluence Community License granted to OpenQA. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.6 Build:#812 Aug 06, 2007) - Bug/feature request - Contact Administrators