Method: Selenium::WebDriver::Firefox::Bridge#initialize

Defined in:
lib/selenium/webdriver/firefox/bridge.rb

#initialize(opts = {}) ⇒ Bridge

Returns a new instance of Bridge.

[View source]

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/selenium/webdriver/firefox/bridge.rb', line 8

def initialize(opts = {})
  @binary     = Binary.new
  @launcher   = Launcher.new(
    @binary,
    opts.delete(:port)    || DEFAULT_PORT,
    opts.delete(:profile) || DEFAULT_PROFILE_NAME
  )

  http_client = opts.delete(:http_client)

  unless opts.empty?
    raise ArgumentError, "unknown option#{'s' if opts.size != 1}: #{opts.inspect}"
  end

  @launcher.launch

  remote_opts = {
    :url                  => @launcher.url,
    :desired_capabilities => :firefox
  }

  remote_opts.merge!(:http_client => http_client) if http_client

  super(remote_opts)
end