Category Archives: Watir

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

Finding visible/hidden elements with the new :visible locator

Watir 6.0 introduces a new locator – :visible. This allows you to specify whether or not the element can be seen by the user. Usage Consider the following page where the first div is visible and first span element is … Continue reading

Posted in Watir | Tagged , | Leave a comment

Finding the next empty text field

Problem As I continued to investigate making Watir-Classic tests compatible with Watir-Webdriver, I noticed one test that failed to input the next empty row of a text field grid. The grid could start empty or it could start with rows … Continue reading

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

Replace Table#row_count and Table#column_count with an ElementCollection#count

Given a table: You might want to check the number of rows and/or columns. Obsolete Method In Watir-Classic you may have retrieved these values using the row_count and column_count methods. However, these methods will give an error in Watir-Webdriver: Preferred … Continue reading

Posted in Watir, Watir Migration, Watir-Classic | Leave a comment

Watir 6.0 is the end of the Watir metagem

The Watir gem started out as driver for IE through the OLE protocol. In 2012, version 4.0.0 changed Watir into a metagem that, based on the desired browser, used either Watir-Classic (the original implementation) or Watir-Webdriver (the Selenium backed implementation … Continue reading

Posted in Watir, Watir-Classic, Watir-Webdriver | 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

Unhiding the overflow:hidden in DevExtreme select lists

Problem When Dev Silver asked me how to automate a DevExtreme select list, it seemed like a simple task. It looked like any other set of elements styled as a select list. It worked! Well… at least for some options. … Continue reading

Posted in Watir, Watir-Webdriver | Tagged , | 2 Comments