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

Checkboxes

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

What you see in the web browser:

Check Me:

This is the tag in the HTML source:

Check Me:<input type="checkbox" id="one" name="checkme">

id Attribute

Watir code to set a checkbox using the id attribute:

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

Watir code to clear a checkbox using the id attribute:

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

name Attribute

Watir code to set a checkbox using the name attribute:

ie.checkbox(:name, "checkme").set

Watir code to clear a checkbox using the name attribute:

ie.checkbox(:name, "checkme").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