Category Archives: Automation

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

Determine the feature directory in Cucumber hooks

Problem Today’s Stack Overflow question, “Is it possible to know from which folder cucumber scenario is running?” by Den Silver, was looking to apply hooks based on a feature file’s folder. While I can see the merit of this approach, … Continue reading

Posted in Cucumber | 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

ParallelTests::RSpec::RuntimeLogger ignores first process

Problem Inspired by a recent meeting with the team at Loblaws Digital, I have been looking at tools to improve the execution of my regression suite. To address an ever growing execution time, I turned to the ParallelTests gem. This … Continue reading

Posted in RSpec | Tagged | 1 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