Sha256: 9d97c999be36ddf624f45ee654f72ee5eaaacdef91d2fee9ba2d056d44436867

Contents?: true

Size: 605 Bytes

Versions: 8

Compression:

Stored size: 605 Bytes

Contents

module Watir
  class TextAreaLocator < ElementLocator

    private

    def normalize_selector(how, what)
      # We need to iterate through located elements and fetch
      # attribute value using WebDriver because XPath doesn't understand
      # difference between IDL vs content attribute.
      # Current ElementLocator design doesn't allow to do that in any
      # obvious way except to use regular expression.
      if how == :value && what.kind_of?(String)
        [how, Regexp.new('^' + Regexp.escape(what) + '$')]
      else
        super
      end
    end

  end # TextAreaLocator
end # Watir

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
watir-webdriver-0.7.0 lib/watir-webdriver/locators/text_area_locator.rb
watir-webdriver-0.6.11 lib/watir-webdriver/locators/text_area_locator.rb
watir-webdriver-0.6.10 lib/watir-webdriver/locators/text_area_locator.rb
watir-webdriver-0.6.9 lib/watir-webdriver/locators/text_area_locator.rb
watir-webdriver-0.6.8 lib/watir-webdriver/locators/text_area_locator.rb
watir-webdriver-0.6.7 lib/watir-webdriver/locators/text_area_locator.rb
watir-webdriver-0.6.6 lib/watir-webdriver/locators/text_area_locator.rb
watir-webdriver-0.6.5 lib/watir-webdriver/locators/text_area_locator.rb