Module: PageObject::Platforms::WatirWebDriver::Table

Defined in:
lib/page-object/platforms/watir_webdriver/table.rb

Instance Method Summary collapse

Instance Method Details

#[](idx) ⇒ PageObject::Elements::TableRow

Return the PageObject::Elements::TableRow for the index provided. Index is zero based. If the index provided is a String then it will be matched with the text from any column. The text can be a substring of the full column text.



14
15
16
17
18
# File 'lib/page-object/platforms/watir_webdriver/table.rb', line 14

def [](idx)
  idx = find_index_by_title(idx) if idx.kind_of?(String)
  return nil unless idx
  initialize_row(element[idx], :platform => :watir_webdriver)
end

#rowsObject

Returns the number of rows in the table.



23
24
25
# File 'lib/page-object/platforms/watir_webdriver/table.rb', line 23

def rows
  element.wd.find_elements(:xpath, child_xpath).size
end