Class: Watir::ElementLocator

Inherits:
TaggedElementLocator show all
Defined in:
lib/watir/locator.rb

Overview

This is like the TaggedElementLocator but get all the elements by forcing @tag to be ‘*’

Instance Method Summary collapse

Methods inherited from TaggedElementLocator

#each_element, #locate, #match?, #set_specifier

Methods inherited from Locator

#normalize_specifiers!

Methods included from Watir

_register, _unregister, autoit, #dialog, until_with_timeout

Constructor Details

#initialize(container) ⇒ ElementLocator

Returns a new instance of ElementLocator.



186
187
188
# File 'lib/watir/locator.rb', line 186

def initialize(container)
  @container = container
end

Instance Method Details

#eachObject



190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/watir/locator.rb', line 190

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