Getting the status of a checkbox 28/11/2012
# Getting the status of a checkbox identified by an ID (using Ruby 1.9 hash syntax)
browser.checkbox(id: 'checkbox-id').set?

# Getting the status of a checkbox identified by a class name (using Ruby 1.9 hash syntax)
browser.checkbox(class: 'checkbox-class').set?

The status of a checkbox can be checked with the methods above. The calls return a boolean value, i.e. true or false.

Checking a checkbox 28/11/2012
# Setting a checkbox identified by an ID (using Ruby 1.9 hash syntax)
browser.checkbox(id: 'checkbox-id').set

# Setting a checkbox identified by a class name (using Ruby 1.9 hash syntax)
browser.checkbox(class: 'checkbox-class').set

Setting a checkbox is quite straightforward in watir-webdriver. First, the element on the page needs to be found with one of the available methods. Once a reference to the element is available, the set method can be used to set it. The same method is available for radio buttons.