Method: Selenium::WebDriver::Remote::Driver#initialize

Defined in:
lib/selenium/webdriver/remote/driver.rb

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

Raises:

  • (ArgumentError)


32
33
34
35
36
37
38
39
# File 'lib/selenium/webdriver/remote/driver.rb', line 32

def initialize(capabilities: nil, options: nil, service: nil, url: nil, **opts)
  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, **opts)
  @bridge.file_detector = ->((filename, *)) { File.exist?(filename) && filename.to_s }
end