Monthly Archives: March 2013

Locating Nokogiri nodes with Watir API

While Nokogiri can help combat Watir performance issues for large pages, I find it tedious to switch between the two. Nokogiri is all about css-selectors and xpath, while Watir typically avoids them. Would it not be nice to locate nodes … Continue reading

Posted in Watir | Tagged | 14 Comments

Passing Watir elements to execute_script

Occasionally, to get certain functionality to execute, you might need to directly execute the javascript. Watir has a built-in method, Browser#execute_script, for doing this. For example, the following script would get the innerHTML of an element. Notice on Line 4 … Continue reading

Posted in Watir-Webdriver | 4 Comments

3 parts to each Watir instruction

A Watir script is simply a series of step-by-step instructions (or commands). For each instruction, there are three parts. The target is who you want to interact with. It can be a single element or a collection of similar elements. … Continue reading

Posted in Watir | Leave a comment

Outline for a future Watir book

If I were to write a book about Watir, it would look like the following. Note that it just lists some of the higher level ideas; there is plenty more to add. Watir Basics Watir Fundamentals Walkthrough Example Target Browser … Continue reading

Posted in Watir | Tagged | 2 Comments