Method: Selenium::WebDriver::Firefox::Launcher#initialize

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

#initialize(binary, port = DEFAULT_PORT, profile = DEFAULT_PROFILE_NAME) ⇒ Launcher

Returns a new instance of Launcher.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/selenium/webdriver/firefox/launcher.rb', line 13

def initialize(binary, port = DEFAULT_PORT, profile = DEFAULT_PROFILE_NAME)
  @binary = binary
  @port   = port.to_i

  if profile.kind_of? Profile
    @profile = profile
  else
    @profile_name = profile
    @profile = nil
  end

  # need to be really specific about what host to use
  #
  # on os x, "localhost" will resolve to 3 different addresses (see /etc/hosts)
  # Ruby will loop over these and happily bind to the same port on each one,
  # making it completely unusable for our purposes.
  #
  @host = "127.0.0.1"
end