Watir 7.0 Beta 3

Written by: Titus Fortner on May 5, 2021

Watir 7.0.0.beta3 is now available on RubyGems. This update includes bug fixes and things that were intended for the last release for Capabilities but overlooked.

To install:

gem install watir --pre

or in your Gemfile:

gem "watir", ">= 7.0.0.beta3"

Unhandled Prompt Behavior

We documented in the capabilities guide the reason for why Watir is going to override the default behavior for Alert Handling. Except we forgot to implement it. It’s non-backward compatible, but we’re in beta. You must send a command to accept or dismiss the Alert if you are rescuing the exception. This will allow users to query whether an alert is present without changing the state of the system.

Driver Timeouts

The Selenium::WebDriver::Timeouts class has always converted script timeout, page load timeout, and implicit wait timeouts from seconds (what the user enters) to milliseconds (what w3c spec expects). When support for setting timeout values was added to the capabilities, it did not convert from seconds to milliseconds. Watir now handles timeouts set in capabilities in a special way.

This is now deprecated:

opts = {timeouts: {page_load: 11000, script: 12000}}
browser = Watir::Browser.new(options: opts)

Instead do this:

opts = {page_load_timeout: 11, script_timeout: 12}}
browser = Watir::Browser.new(options: opts)

Note that Watir will now raise an exception if attempting to set an implicit wait because that conflicts with Watir’s automatic synchronization.

Vendor Capabilities

Watir was not properly handling valid vendor extension capabilities like sauce:options and selenoid:options. This has been fixed.

See the Changelog for the complete history of updates.

Tags:

Thoughts about this article? Let us know!