Tag Archives: checkbox

Set styled radio buttons and checkboxes that have hidden or overlapped the input field

Problem There seems to be an upward trend in applications using label elements to style radio buttons and checkboxes. This can cause issues when Watir tries to set the field. For example: Setting a jQuery Mobile checkbox, results in the … Continue reading

Posted in Watir, Watir-Webdriver | Tagged , | Leave a comment

Toggle a checkbox

Problem Checking a checkbox is as simple as: Clearing a checkbox is just as easy: What if you want to toggle the state of the checkbox – ie check it if its unchecked or uncheck it if it is checked? … Continue reading

Posted in Watir, Watir-Classic, Watir-Webdriver | Tagged | 16 Comments

Getting a checkbox by its adjacent text node

Problem There was an interesting StackOverflow question the other day on being able to set a checkbox based on its text (original selenium-webdriver question). The html in question looked like: You cannot set the second checkbox by doing: The text … Continue reading

Posted in Watir, Watir-Classic, Watir-Webdriver | Tagged , , | Leave a comment