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
11
12
13
# File 'lib/watir-webdriver/row_container.rb', line 8

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

  row
end

#rows(*args) ⇒ Object

Returns table rows collection.



19
20
21
22
23
24
# File 'lib/watir-webdriver/row_container.rb', line 19

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:

  • (Array<Array<String>>)


32
33
34
35
36
37
38
# File 'lib/watir-webdriver/row_container.rb', line 32

def strings
  assert_exists

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