Class: Selenium::WebDriver::Firefox::Service

Inherits:
Service
  • Object
show all
Defined in:
lib/selenium/webdriver/firefox/service.rb

Constant Summary collapse

DEFAULT_PORT =
4444
EXECUTABLE =
'geckodriver'
SHUTDOWN_SUPPORTED =
false
DRIVER_PATH_ENV_KEY =
'SE_GECKODRIVER'

Instance Attribute Summary

Attributes inherited from Service

#args, #executable_path, #host, #log, #port

Instance Method Summary collapse

Methods inherited from Service

chrome, edge, #env_path, #find_driver_path, firefox, ie, #launch, safari, #shutdown_supported

Constructor Details

#initialize(args: nil) ⇒ Service

Returns a new instance of Service.



29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/selenium/webdriver/firefox/service.rb', line 29

def initialize(args: nil, **)
  args = Array(args.dup)
  unless args.any? { |arg| arg.include?('--connect-existing') || arg.include?('--websocket-port') }
    args << '--websocket-port'
    args << '0'
  end

  if ENV.key?('SE_DEBUG')
    remove_log_args(args)
    args << '-v'
  end

  super
end