Sha256: a1498d61b33d9c7508d901c306e5103f993565828469a84decb730752663a967

Contents?: true

Size: 1.24 KB

Versions: 2

Compression:

Stored size: 1.24 KB

Contents

module Selenium
  module WebDriver
    module Firefox

      # @private
      class Bridge < Remote::Bridge

        def initialize(opts = {})
          @binary     = Binary.new
          @launcher   = Launcher.new(
            @binary,
            opts.delete(:port)    || DEFAULT_PORT,
            opts.delete(:profile) || DEFAULT_PROFILE_NAME
          )

          unless opts.empty?
            raise ArgumentError, "unknown option#{'s' if opts.size != 1}: #{opts.inspect}"
          end

          @launcher.launch
          super :url => @launcher.connection.url, :desired_capabilities => :firefox
        end

        def browser
          :firefox
        end

        def driver_extensions
          [DriverExtensions::TakesScreenshot]
        end

        def quit
          super
          @binary.wait rescue nil # might raise on windows

          nil
        end

        def getScreenshot
          execute :screenshot
        end

        def findElementByCssSelector(parent, selector)
          find_element_by 'css selector', selector, parent
        end

        def findElementsByCssSelector(parent, selector)
          find_elements_by 'css selector', selector, parent
        end

      end # Bridge
    end # Firefox
  end # WebDriver
end # Selenium

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
selenium-webdriver-0.0.19 firefox/src/rb/lib/selenium/webdriver/firefox/bridge.rb
selenium-webdriver-0.0.18 firefox/src/rb/lib/selenium/webdriver/firefox/bridge.rb