class FireWatir::TableRow

Description: Class for Table row element.

Attributes

element_name[RW]

Public Class Methods

new(container, how, what) click to toggle source

Description:

Initializes the instance of table row object.

Input:

- how - Attribute to identify the table row element.
- what - Value of that attribute.
# File lib/firewatir/elements/table_row.rb, line 34
def initialize(container, how, what)
  @how = how
  @what = what
  @container = container
  #super nil

end

Public Instance Methods

[](key) click to toggle source

Description:

Get cell at specified index in a row.

Input:

key - column index.

Output:

Table cell element at specified index.
# File lib/firewatir/elements/table_row.rb, line 64
def [] (key)
  assert_exists
  arr_cells = cells
  return arr_cells[key - 1]
end
cells() click to toggle source

Description:

Get array of all cells in Table Row

Output:

Array containing Table Cell elements.
# File lib/firewatir/elements/table_row.rb, line 89
def cells
  assert_exists
  arr_cells = get_cells
  row_cells = Array.new(arr_cells.length)
  for i in 0..arr_cells.length - 1 do
    row_cells[i] = TableCell.new(@container, :jssh_name, arr_cells[i])
  end
  return row_cells
end
column_count() click to toggle source

Description:

Gets the length of columns in table row.

Output:

Length of columns in table row.
# File lib/firewatir/elements/table_row.rb, line 48
def column_count
  assert_exists
  arr_cells = cells
  return arr_cells.length
end
each() { |arr_cells| ... } click to toggle source

Description:

Iterate over each cell in a row.
# File lib/firewatir/elements/table_row.rb, line 74
def each
  assert_exists
  arr_cells = cells
  for i in 0..arr_cells.length - 1 do
    yield arr_cells[i]
  end
end
locate() click to toggle source

Description:

Locate the table row element on the page.
# File lib/firewatir/elements/table_row.rb, line 13
def locate
  @o = nil
  case @how
  when :jssh_name
    @element_name = @what
  when :xpath
    @element_name = element_by_xpath(@container, @what)
  else
    @element_name = locate_tagged_element("TR", @how, @what)
  end
  @o = self
end