Class: Watir::TableRowCollection

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

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



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

def locator_class
  @locator_class || super
end

Instance Method Details

#element_classObject



306
307
308
# File 'lib/watir-webdriver/elements/generated.rb', line 306

def element_class
  TableRow
end

#elementsObject



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

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