class Selenium::WebDriver::Remote::Driver
Driver implementation for remote server. @api private
Public Class Methods
new(capabilities: nil, options: nil, service: nil, url: nil, **opts)
click to toggle source
Calls superclass method
Selenium::WebDriver::Driver::new
# 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
Private Instance Methods
devtools_url()
click to toggle source
# File lib/selenium/webdriver/remote/driver.rb, line 43 def devtools_url capabilities['se:cdp'] end
devtools_version()
click to toggle source
# File lib/selenium/webdriver/remote/driver.rb, line 47 def devtools_version capabilities['se:cdpVersion']&.split('.')&.first || raise(Error::WebDriverError, 'DevTools is not supported by the Remote Server') end
process_options(options, capabilities)
click to toggle source
Calls superclass method
Selenium::WebDriver::Driver#process_options
# File lib/selenium/webdriver/remote/driver.rb, line 52 def process_options(options, capabilities) raise ArgumentError, "#{self.class} needs :options to be set" if options.nil? && capabilities.nil? super(options, capabilities) end