Module: PageObject::Platforms::WatirWebDriver::TableRow
- Defined in:
- lib/page-object/platforms/watir_webdriver/table_row.rb
Instance Method Summary collapse
-
#[](idx) ⇒ Object
Return the PageObject::Elements::TableCell for the index provided.
-
#columns ⇒ Object
Returns the number of columns in the table.
Instance Method Details
#[](idx) ⇒ Object
Return the PageObject::Elements::TableCell for the index provided. Index is zero based. If the index provided is a String then it will be matched with the text from the columns in the first row. The text can be a substring of the full column text.
12 13 14 15 16 |
# File 'lib/page-object/platforms/watir_webdriver/table_row.rb', line 12 def [](idx) idx = find_index_by_title(idx) if idx.kind_of?(String) return nil unless idx && columns >= idx + 1 initialize_cell(element[idx], :platform => :watir_webdriver) end |
#columns ⇒ Object
Returns the number of columns in the table.
21 22 23 |
# File 'lib/page-object/platforms/watir_webdriver/table_row.rb', line 21 def columns element.wd.find_elements(:xpath, child_xpath).size end |