Category Archives: Watir

The many code paths of the :id locator

Problem While investigating the changes needed for Pull Request #662, I noticed that the :id locator had quite a few code paths. For example, the locator could be: Directly passed on to Selenium-WebDriver Incorporated into an XPath expression Compared while … Continue reading

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

Text field performance – #set vs #set!

Problem While investigating an issue for TextField#set!, I noticed that the method was: Notice that it calls the normal #set for the first character, as well as another call for the middle of the value, the end and validation. At … Continue reading

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

Reproducing the compound class error

Problem A Stack Overflow question by BIGJOHN mentioned getting a “compound class names not permitted error.” The usage of the compound class was obvious: The question is, where is this exception coming from? Compound class names, while on the list … Continue reading

Posted in Watir | Tagged , | Leave a comment

Attach to a manually opened Chrome browser using debuggerAddress

Problem Watir-Classic can attach to manually opened browsers. This is a great benefit when using Watir to aid manual testing efforts. It is also helpful when developing automated tests. However, for the longest time, this was not possible with Watir(-Webdriver). … Continue reading

Posted in Watir, Watir-Webdriver | Tagged , , | 1 Comment

Locate by classes in a specific order

Problem In HTML, the class attribute is a space-separated list of classes for the element. The order of classes does not matter when applying style sheets. For example, in the following page, all 3 div elements would look the same … Continue reading

Posted in Watir | Tagged , | Leave a comment

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 , | 7 Comments