Class: Watir::TableRowCollection

Inherits:
ElementCollection show all
Defined in:
lib/watir-webdriver/elements/table_row.rb,
lib/watir-webdriver/elements/generated.rb

Overview

TableRow

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ElementCollection

#[], #each, #first, #initialize, #last, #length, #to_a

Constructor Details

This class inherits a constructor from Watir::ElementCollection

Instance Attribute Details

#locator_classObject



40
41
42
# File 'lib/watir-webdriver/elements/table_row.rb', line 40

def locator_class
  @locator_class || super
end

Instance Method Details

#element_classObject



578
579
580
# File 'lib/watir-webdriver/elements/generated.rb', line 578

def element_class
  TableRow
end

#elementsObject



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/watir-webdriver/elements/table_row.rb', line 28

def elements
  # we do this craziness since the xpath used will find direct child rows
  # before any rows inside thead/tbody/tfoot...
  elements = super

  if locator_class == ChildRowLocator and @parent.kind_of? Table
    elements = elements.sort_by { |row| row.attribute(:rowIndex).to_i }
  end

  elements
end