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



4
5
6
7
8
9
# File 'lib/watir-webdriver/row_container.rb', line 4

def row(*args)
  row = tr(*args)
  row.locator_class = ChildRowLocator

  row
end

#rows(*args) ⇒ Object



11
12
13
14
15
16
# File 'lib/watir-webdriver/row_container.rb', line 11

def rows(*args)
  rows = trs(*args)
  rows.locator_class = ChildRowLocator

  rows
end

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

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

Returns:



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

def strings
  assert_exists

  rows.inject [] do |res, row|
    res << row.cells.map { |cell| cell.text }
  end
end