Sha256: 4f89d8eff8fb6dde87bc3342fbf667b098e1083228417c135409576dcc033b9b

Contents?: true

Size: 937 Bytes

Versions: 18

Compression:

Stored size: 937 Bytes

Contents

module PageObject
  module Platforms
    module SeleniumWebDriver
      module Table

        #
        # Return the PageObject::Elements::TableRow for the index provided.  Index
        # is zero based.
        #
        # @return [PageObject::Elements::TableRow]
        #
        def [](idx)
          eles = table_rows
          Object::PageObject::Elements::TableRow.new(eles[idx], :platform => :selenium_webdriver)
        end

        #
        # Returns the number of rows in the table.
        #
        def rows
          table_rows.size
        end

        #
        # override PageObject::Platforms::SeleniumElement because exists? is not
        # available on a table element in Selenium.
        #
        def exists?
          raise "exists? not available on table element"
        end

        private

        def table_rows
          @element.find_elements(:xpath, child_xpath)
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
page-object-0.6.3 lib/page-object/platforms/selenium_webdriver/table.rb
page-object-0.6.2 lib/page-object/platforms/selenium_webdriver/table.rb
page-object-0.6.1 lib/page-object/platforms/selenium_webdriver/table.rb
page-object-0.6 lib/page-object/platforms/selenium_webdriver/table.rb
page-object-0.5.5 lib/page-object/platforms/selenium_webdriver/table.rb
page-object-0.5.4 lib/page-object/platforms/selenium_webdriver/table.rb
page-object-0.5.3 lib/page-object/platforms/selenium_webdriver/table.rb
page-object-0.5.2 lib/page-object/platforms/selenium_webdriver/table.rb
page-object-0.5.1 lib/page-object/platforms/selenium_webdriver/table.rb
page-object-0.5.0 lib/page-object/platforms/selenium_webdriver/table.rb
page-object-0.4.4 lib/page-object/platforms/selenium_webdriver/table.rb
page-object-0.4.3 lib/page-object/platforms/selenium_webdriver/table.rb
page-object-0.4.2 lib/page-object/platforms/selenium_webdriver/table.rb
page-object-0.4.1 lib/page-object/platforms/selenium_webdriver/table.rb
page-object-0.4.0 lib/page-object/platforms/selenium_webdriver/table.rb
page-object-0.3.2 lib/page-object/platforms/selenium_webdriver/table.rb
page-object-0.3.1 lib/page-object/platforms/selenium_webdriver/table.rb
page-object-0.3.0 lib/page-object/platforms/selenium_webdriver/table.rb