Watir 7.0 Released!

Written by: Titus Fortner on October 18, 2021

Watir 7.0.0 is now available on RubyGems. It requires Ruby 2.6+ and Selenium 4.0 which was just released last week. It’s been a long road since Watir 6.0 was released almost 5 years ago. That version was a substantial reenvisiong of Watir’s default approach to automation, especially as it relates to Selenium. It was designed to combine the original philosophy of Watir with the power of Selenium. Watir 7 is mostly just a much more stable and performant implementation of that vision. As of this release, there are no outstanding Pull Requests or reported bugs in our Issue Tracker!

To install:

gem install watir

or in your Gemfile:

gem "watir", "~> 7.0"

New Windows Commands

Since Watir 7.0.0.beta5 2 new commands were implemented for Windows: Window#minimize and Window#full_screen. They both do about what you would expect, but be careful as there is no easy way to restore the browser to the previous state.

If you need to restore your window to previous size and position, you might need code like:

original_size = @browser.window.size
original_position = @browser.window.position
@browser.window.maximize
@browser.window.resize_to(*original_size)
@browser.window.resize_to(*original_size)

Changes from 6.19

A quick recap of the work that was done in the beta releases:

Watir 7.0.0.beta1: This removed all the deprecations and provided a clean slate for udpates

Watir 7.0.0.beta2: This added the features we couldn’t use with the deprecated code and/or without Selenium 4.

Watir 7.0.0.beta3: This was just bug fixes and some changes in defaults.

See the Changelog for the complete history of updates.

Tags:

Thoughts about this article? Let us know!