Class: Selenium::WebDriver::Remote::Driver Private

Inherits:
Driver
  • Object
show all
Includes:
DriverExtensions::HasRemoteStatus, DriverExtensions::HasSessionId, DriverExtensions::HasWebStorage, DriverExtensions::Rotatable, DriverExtensions::TakesScreenshot, DriverExtensions::UploadsFiles
Defined in:
build/rb/lib/selenium/webdriver/remote/driver.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Driver implementation for remote server.

Constant Summary

Constants included from DriverExtensions::Rotatable

DriverExtensions::Rotatable::ORIENTATIONS

Constants included from SearchContext

SearchContext::FINDERS

Instance Method Summary collapse

Methods included from DriverExtensions::HasWebStorage

#local_storage, #session_storage

Methods included from DriverExtensions::HasRemoteStatus

#remote_status

Methods included from DriverExtensions::Rotatable

#orientation, #rotation=

Methods included from DriverExtensions::HasSessionId

#session_id

Methods included from DriverExtensions::TakesScreenshot

#save_screenshot, #screenshot_as

Methods included from DriverExtensions::UploadsFiles

#file_detector=

Methods inherited from Driver

#[], #action, #browser, #capabilities, #close, #current_url, #execute_async_script, #execute_script, for, #get, #inspect, #keyboard, #manage, #mouse, #navigate, #page_source, #quit, #ref, #switch_to, #title, #window_handle, #window_handles

Methods included from SearchContext

#find_element, #find_elements

Constructor Details

#initialize(opts = {}) ⇒ Driver

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Driver



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'build/rb/lib/selenium/webdriver/remote/driver.rb', line 37

def initialize(opts = {})
  listener = opts.delete(:listener)
  desired_capabilities = opts.delete(:desired_capabilities) { Capabilities.new }

  if desired_capabilities.is_a?(Symbol)
    unless Capabilities.respond_to?(desired_capabilities)
      raise Error::WebDriverError, "invalid desired capability: #{desired_capabilities.inspect}"
    end

    desired_capabilities = Capabilities.__send__(desired_capabilities)
  end

  @bridge = Bridge.new(opts)
  @bridge.create_session(desired_capabilities, opts.delete(:options))

  super(@bridge, listener: listener)
end