Class: Watir::TableCell

Inherits:
Element show all
Includes:
Container, Exception
Defined in:
lib/watir/table.rb

Overview

this class is a table cell - when called via the Table object

Constant Summary

Constants inherited from Element

Element::TO_S_SIZE

Instance Attribute Summary

Attributes included from Container

#activeObjectHighLightColor, #page_container, #type_keys, #typingspeed

Attributes inherited from Element

#container

Instance Method Summary collapse

Methods included from Container

#area, #areas, #button, #buttons, #cell, #cells, #checkbox, #checkboxes, #dds, #divs, #dls, #dts, #element, #elements, #ems, #file_field, #file_fields, #form, #forms, #frame, #hidden, #hiddens, #image, #images, #labels, #link, #links, #lis, #locate_all_elements, #locate_input_element, #locate_tagged_element, #log, #map, #maps, #modal_dialog, #popup, #pres, #ps, #radio, #radios, #row, #rows, #select_list, #select_lists, #set_container, #show_all_objects, #spans, #strongs, #table, #tables, #text_field, #text_fields, #wait

Methods inherited from Element

#<=>, #activeObjectHighLightColor, #after_text, #assert_enabled, #assert_exists, #attribute_value, #before_text, #click, #click!, #click_no_wait, #enabled?, #exists?, #fire_event, #flash, #focus, #inspect, #ole_object, #ole_object=, #parent, #text, #type_keys, #typingspeed, #visible?

Constructor Details

#initialize(container, how, what) ⇒ TableCell

Returns an initialized instance of a table cell

* container  - an  IE object
* how        - symbol - how we access the cell
* what       - what we use to access the cell - id, name index etc


369
370
371
372
373
374
# File 'lib/watir/table.rb', line 369

def initialize(container, how, what)
  set_container container
  @how = how
  @what = what
  super nil
end

Instance Method Details

#colspanObject



389
390
391
392
# File 'lib/watir/table.rb', line 389

def colspan
  locate
  @o.colSpan
end

#documentObject



382
383
384
385
# File 'lib/watir/table.rb', line 382

def document
  locate
  return @o
end

#locateObject



355
356
357
358
359
360
361
362
363
# File 'lib/watir/table.rb', line 355

def locate
  if @how == :xpath
    @o = @container.element_by_xpath(@what)
  elsif @how == :ole_object
    @o = @what
  else
    @o = @container.locate_tagged_element("TD", @how, @what)
  end
end