Class: Watir::ElementLocator
- Inherits:
-
TaggedElementLocator
- Object
- Locator
- TaggedElementLocator
- Watir::ElementLocator
- Defined in:
- lib/watir/locator.rb
Overview
This is like the TaggedElementLocator but get all the elements by forcing @tag to be ‘*’
Constant Summary
Constants included from Watir
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(container) ⇒ ElementLocator
constructor
A new instance of ElementLocator.
Methods inherited from TaggedElementLocator
#each_element, #locate, #match?, #set_specifier
Methods inherited from Locator
Methods included from Watir
_register, _unregister, autoit, #dialog, until_with_timeout
Constructor Details
#initialize(container) ⇒ ElementLocator
Returns a new instance of ElementLocator.
179 180 181 |
# File 'lib/watir/locator.rb', line 179 def initialize(container) @container = container end |
Instance Method Details
#each ⇒ Object
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/watir/locator.rb', line 183 def each count = 0 each_element('*') do |element| catch :next_element do @specifiers.each do |how, what| next if how == :index unless match? element, how, what throw :next_element end end yield element end end nil end |