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

Inherits:
Driver
  • Object
show all
Includes:
DriverExtensions::HasFileDownloads, DriverExtensions::HasSessionEvents, DriverExtensions::HasSessionId, DriverExtensions::UploadsFiles
Defined in:
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.

API:

  • private

Constant Summary

Constants included from SearchContext

SearchContext::FINDERS

Instance Method Summary collapse

Methods included from DriverExtensions::HasSessionEvents

#fire_session_event

Methods included from DriverExtensions::HasFileDownloads

#delete_downloadable_files, #download_file, #downloadable_files

Methods included from DriverExtensions::HasSessionId

#session_id

Methods included from DriverExtensions::UploadsFiles

#file_detector=

Methods inherited from Driver

#[], #action, #add_virtual_authenticator, #browser, #capabilities, #close, #current_url, #execute_async_script, #execute_script, for, #get, #inspect, #manage, #navigate, #network, #page_source, #quit, #ref, #script, #status, #switch_to, #title, #window_handle, #window_handles

Methods included from TakesScreenshot

#save_screenshot, #screenshot_as

Methods included from SearchContext

#find_element, #find_elements, finders

Constructor Details

#initialize(capabilities: nil, options: nil, service: nil, url: nil) ⇒ 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.

Raises:

API:

  • private



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/selenium/webdriver/remote/driver.rb', line 34

def initialize(capabilities: nil, options: nil, service: nil, url: nil, **)
  raise ArgumentError, "Can not set :service object on #{self.class}" if service

  url ||= "http://#{Platform.localhost}:4444/wd/hub"
  caps = process_options(options, capabilities)
  super(caps: caps, url: url, **)
  @bridge.file_detector = ->((filename, *)) { File.exist?(filename) && filename.to_s }
  command_list = @bridge.command_list
  @bridge.extend(WebDriver::Remote::Features)
  @bridge.add_commands(command_list)
end