Class: Watir::TableRowLocator

Inherits:
ElementLocator show all
Defined in:
lib/watir-webdriver/locators/table_row_locator.rb

Constant Summary

Constants inherited from ElementLocator

ElementLocator::WD_FINDERS

Instance Method Summary collapse

Methods inherited from ElementLocator

#assert_valid_as_attribute, #attribute_expression, #by_id, #check_type, #delete_regexps_from, #equal_pair, #fetch_value, #find_all_by_multiple, #find_all_by_one, #find_first_by_multiple, #find_first_by_one, #initialize, #lhs_for, #locate, #matches_selector?, #normalize_selector, #normalized_selector, #tag_name_matches?, #wd_find_all_by, #wd_find_by_regexp_selector, #wd_find_first_by

Constructor Details

This class inherits a constructor from Watir::ElementLocator

Instance Method Details

#build_xpath(selectors) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/watir-webdriver/locators/table_row_locator.rb', line 8

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

#locate_allObject



4
5
6
# File 'lib/watir-webdriver/locators/table_row_locator.rb', line 4

def locate_all
  find_all_by_multiple
end