Sha256: 4ac9975b67f8a9811b6bb694e2b378f3150f935d864f1233c36a42a504d745ad

Contents?: true

Size: 686 Bytes

Versions: 2

Compression:

Stored size: 686 Bytes

Contents

module Watir
  module Locators
    class TextArea
      class SelectorBuilder < Element::SelectorBuilder
        private

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
watir-6.15.1 lib/watir/locators/text_area/selector_builder.rb
watir-6.15.0 lib/watir/locators/text_area/selector_builder.rb