Sha256: 96d6749fc13efa9e1145a5c938ed87e0800754a43177a256d00fcf9d2325125d

Contents?: true

Size: 935 Bytes

Versions: 15

Compression:

Stored size: 935 Bytes

Contents

module PageObject
  module Platforms
    module SeleniumWebDriver
      module SelectList

        #
        # Return the PageObject::Elements::Option for the index provided.  Index
        # is zero based.
        #
        # @return [PageObject::Elements::Option]
        #
        def [](idx)
          options[idx]
        end
        
        #
        # Select a value from the list
        #
        def select(value)
          @element.send_keys(value)
        end

        #
        # Return an array of Options contained in the select lit.
        #
        # @return [array of PageObject::Elements::Option]
        def options
          options = @element.find_elements(:xpath, child_xpath)
          elements = []
          options.each do |opt|
            elements << Object::PageObject::Elements::Option.new(opt, :platform => :selenium_webdriver)
          end
          elements
        end
      end
    end
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

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