Watir 6.1 Released!

Written by: Titus Fortner on January 4, 2017

Watir 6.1 is now available on RubyGems! In addition to Ruby 2.4 support we’ve added a couple new features and bug fixes.

To install:

gem install watir

or in your Gemfile:

gem "watir", "~> 6.1"

Polling Intervals for Waits

With the switch to keywords we can add new ones where needed. The polling interval is the length of time between retrying the command in the wait block. Up until now it has been hard coded at 0.1 seconds. If you are waiting for something that is going to take longer than a second, it could make sense to increase this value to reduce the unnecessary pinging of your server, etc.

Use the keyword parameter just like you would for timeout and message:

browser.div(id: 'first').wait_until(interval: 0.5, &:present?)

Visible Locator for Collections

Watir 6.0 introduced the visible locator to find the first matching element that is or is not hidden. You can now get a collection of all elements that are hidden or visible.

For example:

browser.divs(class: 'shy', visible: true)

See the Changelog for the complete history of updates.