Class: Watir::TableRow

Inherits:
Element show all
Includes:
TableCellsContainer
Defined in:
lib/watir-classic/table.rb

Overview

Returned by Container#tr.

Instance Attribute Summary

Attributes inherited from Element

#container

Attributes included from Container

#page_container

Instance Method Summary collapse

Methods included from TableCellsContainer

#cell, #cells

Methods inherited from Element

#<=>, #attribute_value, #class_name, #click, #disabled?, #double_click, #enabled?, #exists?, #fire_event, #flash, #focus, #focused?, #id, #initialize, #inner_html, #inspect, #method_missing, #ole_object, #outer_html, #parent, #right_click, #send_keys, #style, #tag_name, #text, #title, #to_s, #to_subtype, #unique_number, #visible?

Methods included from DragAndDropHelper

#drag_and_drop_by, #drag_and_drop_on

Methods included from Container

#a, #abbr, #address, #alert, #area, #article, #aside, #audio, #b, #base, #bdi, #bdo, #blockquote, #body, #br, #button, #canvas, #caption, #checkbox, #cite, #code, #col, #colgroup, #command, #data, #datalist, #dd, #del, #details, #dfn, #div, #dl, #dt, #element, #em, #embed, #fieldset, #figcaption, #figure, #file_field, #font, #footer, #form, #frame, #frameset, #h1, #h2, #h3, #h4, #h5, #h6, #head, #header, #hgroup, #hidden, #hr, #i, #img, #input, #ins, #kbd, #keygen, #label, #legend, #li, #map, #mark, #menu, #meta, #meter, #modal_dialog, #nav, #noscript, #object, #ol, #optgroup, #option, #output, #p, #param, #pre, #progress, #q, #radio, #rp, #rt, #ruby, #s, #samp, #script, #section, #select, #small, #source, #span, #strong, #style, #sub, #summary, #sup, #table, #tbody, #td, #text_field, #textarea, #tfoot, #th, #thead, #time, #title, #tr, #track, #u, #ul, #var, #video, #wbr

Methods included from Exception

message_for_unable_to_locate

Methods included from ElementExtensions

#present?, #wait_until_present, #wait_while_present, #when_present

Constructor Details

This class inherits a constructor from Watir::Element

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Watir::Element

Instance Method Details

#[](index) ⇒ TableCell

Returns cell from the row.

Parameters:

  • index (Fixnum)

    cell index in the row.

Returns:



203
204
205
206
207
208
209
# File 'lib/watir-classic/table.rb', line 203

def [](index)
  assert_exists
  if cells.length <= index
    raise UnknownCellException, "Unable to locate a cell at index #{index}" 
  end
  cells[index]
end

#column_countFixnum

Returns cells count in the row.

Returns:

  • (Fixnum)

    cells count in the row.



213
214
215
216
# File 'lib/watir-classic/table.rb', line 213

def column_count
  assert_exists
  cells.length
end

#each {|cell| ... } ⇒ Object

Iterate over each of the cell in the row.

Yield Parameters:



195
196
197
198
# File 'lib/watir-classic/table.rb', line 195

def each
  locate
  cells.each {|cell| yield cell}
end