Module: Watir::RowContainer

Included in:
Table, TableSection
Defined in:
lib/watir-webdriver/row_container.rb

Instance Method Summary collapse

Instance Method Details

#row(*args) ⇒ Object

Returns table row.



8
9
10
# File 'lib/watir-webdriver/row_container.rb', line 8

def row(*args)
  Row.new(self, extract_selector(args).merge(tag_name: "tr"))
end

#rows(*args) ⇒ Object

Returns table rows collection.



16
17
18
# File 'lib/watir-webdriver/row_container.rb', line 16

def rows(*args)
  RowCollection.new(self, extract_selector(args).merge(tag_name: "tr"))
end

#stringsArray<Array<String>> Also known as: to_a

The table as a 2D Array of strings with the text of each cell.

Returns:

  • (Array<Array<String>>)


26
27
28
29
30
31
32
# File 'lib/watir-webdriver/row_container.rb', line 26

def strings
  assert_exists

  rows.inject [] do |res, row|
    res << row.cells.map(&:text)
  end
end