Parent

Class/Module Index [+]

Quicksearch

Selenium::WebDriver::Firefox::Binary

@private

Public Class Methods

new() click to toggle source
# File firefox/src/rb/lib/selenium/webdriver/firefox/binary.rb, line 8
def initialize
  ENV['MOZ_NO_REMOTE'] = '1' # able to launch multiple instances
end

Public Instance Methods

cope_with_mac_strangeness(args) click to toggle source
# File firefox/src/rb/lib/selenium/webdriver/firefox/binary.rb, line 36
def cope_with_mac_strangeness(args)
  sleep 0.3

  if @process.ugly_death?
    # process crashed, trying a restart. sleeping 5 seconds shorter than the java driver
    sleep 5
    execute(*args)
  end

  # ensure we're ok
  sleep 0.3
  if @process.ugly_death?
    raise Error::WebDriverError, "unable to start Firefox cleanly, args: #{args.inspect}"
  end
end
create_base_profile(name) click to toggle source
# File firefox/src/rb/lib/selenium/webdriver/firefox/binary.rb, line 12
def create_base_profile(name)
  execute("-CreateProfile", name)

  status = nil
  Timeout.timeout(15, Error::TimeOutError) do
    _, status = wait
  end

  if status && status.to_i != 0
    raise Error::WebDriverError, "could not create base profile: (exit status: #{status})"
  end
end
execute(*extra_args) click to toggle source
# File firefox/src/rb/lib/selenium/webdriver/firefox/binary.rb, line 31
def execute(*extra_args)
  args = [self.class.path, "-no-remote", "--verbose"] + extra_args
  @process = ChildProcess.new(*args).start
end
kill() click to toggle source
# File firefox/src/rb/lib/selenium/webdriver/firefox/binary.rb, line 56
def kill
  @process.kill if @process
end
pid() click to toggle source
# File firefox/src/rb/lib/selenium/webdriver/firefox/binary.rb, line 64
def pid
  @process.pid if @process
end
quit() click to toggle source
# File firefox/src/rb/lib/selenium/webdriver/firefox/binary.rb, line 52
def quit
  @process.ensure_death if @process
end
start_with(profile, *args) click to toggle source
# File firefox/src/rb/lib/selenium/webdriver/firefox/binary.rb, line 25
def start_with(profile, *args)
  ENV['XRE_PROFILE_PATH'] = profile.absolute_path
  execute(*args)
  cope_with_mac_strangeness(args) if Platform.mac?
end
wait() click to toggle source
# File firefox/src/rb/lib/selenium/webdriver/firefox/binary.rb, line 60
def wait
  @process.wait if @process
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.