Sha256: 7c38e083c189c5e21d758dd3538ebbee7f831695c8317436a0796f13676a769d

Contents?: true

Size: 519 Bytes

Versions: 14

Compression:

Stored size: 519 Bytes

Contents

module Watir
  class TableRowLocator < ElementLocator

    def locate_all
      find_all_by_multiple
    end

    def build_xpath(selectors)
      return if selectors.values.any? { |e| e.kind_of? Regexp }

      selectors.delete(:tag_name) || raise("internal error: no tag_name?!")

      attr_expr = attribute_expression(selectors)


      xpath = "./*/child::tr"
      xpath << "[#{attr_expr}]" unless attr_expr.empty?

      p :build_xpath => xpath if $DEBUG

      xpath
    end

  end # TableRowLocator
end # Watir

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
watir-webdriver-0.0.7 lib/watir-webdriver/locators/table_row_locator.rb
watir-webdriver-0.0.6 lib/watir-webdriver/locators/table_row_locator.rb
watir-webdriver-0.0.5 lib/watir-webdriver/locators/table_row_locator.rb
watir-webdriver-0.0.4 lib/watir-webdriver/locators/table_row_locator.rb
watir-webdriver-0.0.3 lib/watir-webdriver/locators/table_row_locator.rb
watir-webdriver-0.0.2 lib/watir-webdriver/locators/table_row_locator.rb
watir-webdriver-0.0.1 lib/watir-webdriver/locators/table_row_locator.rb
watir-webdriver-0.0.1.dev7 lib/watir-webdriver/locators/table_row_locator.rb
watir-webdriver-0.0.1.dev6 lib/watir-webdriver/locators/table_row_locator.rb
watir-webdriver-0.0.1.dev5 lib/watir-webdriver/locators/table_row_locator.rb
watir-webdriver-0.0.1.dev4 lib/watir-webdriver/locators/table_row_locator.rb
watir-webdriver-0.0.1.dev3 lib/watir-webdriver/locators/table_row_locator.rb
watir-webdriver-0.0.1.dev2 lib/watir-webdriver/locators/table_row_locator.rb
watir-webdriver-0.0.1.dev lib/watir-webdriver/locators/table_row_locator.rb