Watir 6.3.0 is now available on RubyGems! A few fun new features have been added for this release.
To install:
or in your Gemfile:
Locate elements based on presence/absence of an attribute
Let’s say we have these three elements:
Previously, in order to locate the second element you would need to use an index:
Now you can use the fact that data-bar
is not present:
Or say you want to get a collection of everything that has a specific
attribute, regardless of what the value is. It used to be the only way to
accomplish this was with regular expressions. Now you can use the much more
readable syntax:
Element Flash Attributes
Watir has long supported the ability to make a located element flash on the screen (useful for debugging or demonstrations). Now you can specify:
- the color the element will flash (default is red)
- the number of times the element will flash (default is 10)
- the delay in seconds between flashes (default is 0)
For example:
Select List text
For a Select List like this:
Watir has long allowed getting the value of the selected option like this:
Now you can also get the text of the selected option the same way:
Thanks
Big thanks to three new Watir committers for their contributions to this release:
See the Changelog for the complete history of updates.