Class: Watir::Locator

Inherits:
Object
  • Object
show all
Includes:
Watir, Exception
Defined in:
lib/watir/locator.rb

Direct Known Subclasses

InputElementLocator, TaggedElementLocator

Instance Method Summary collapse

Methods included from Watir

_register, _unregister, autoit, #dialog, until_with_timeout

Instance Method Details

#match_with_specifiers?(element) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
28
29
30
31
# File 'lib/watir/locator.rb', line 25

def match_with_specifiers?(element)
  @specifiers.each do |how, what|
    next if how == :index
    return false unless match? element, how, what
  end
  return true
end

#normalize_specifiers!(specifiers) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/watir/locator.rb', line 6

def normalize_specifiers!(specifiers)
  specifiers.each do |how, what|
    case how
    when :index
      what = what.to_i
    when :url
      how = :href
    when :class
      how = :class_name
    when :caption
      how = :value
    when :method
      how = :form_method
    end

    @specifiers[how] = what
  end
end