Watir 6.8.0 is now available on RubyGems! Several new features including new methods to increase performance.
or in your Gemfile:
Drivers are slow when it comes to typing text. Typically the intent of a test that enters text into a field is to verify:
- the user can type into the field
- the actions associated with events get fired
- the application properly handles the data
None of these three things require that a driver type each character.
By using a
Element#set! instead of
Element#set, Watir will:
- send clear via the applicable driver command to ensure the user can interact with the field
- type the last character via the applicable driver command to ensure that appropriate events get fired
Depending on how much text is being entered, this could provide a huge performance improvement without negatively impacting the effectiveness of the test.
Element#set!, Watir now supports bang (
!) methods with
The clicks are unlikely to provide a performance improvement and should be used sparingly. The Select methods have the potential to decrease the time it takes to interact with especially large select lists.
Let us know what kind of performance improvements you see with these methods.
Input elements of
type="radio" are not independent (clicking one radio button in a
set will de-select another radio button in the set), but until now Watir has required
users to treat them independently.
Element#radio_set now allows users to
identify the collection of related radio buttons and interact with it
similarly to how one currently interacts with a Select List.
RadioSet is initialized with a locator for any of the constituent radio buttons.
name value is the same between radio buttons, the
by their locators will be the same:
- Can be iterated over
- Returns currently selected radio button with
- Returns text and value of the selected radio button with
- Returns whether the radio button with the provided label/text is
currently selected with
- Selects the radio button with the specified label/text with:
Selecting drop down options
Select#select_value has been deprecated.
Select#select will now allow users
to locate elements by text, label or value. Having one primary way to select
options both matches the original Watir implementation as well as making it
easier to support automatic form filling methods in Page Object libraries.
Sometimes a user might want to click on the label of an input element instead of the
element itself. With the new
Input#label, a user can now do:
See the Changelog for the complete history of updates.