### Home Classes Methods

### In Files

- firefox/src/rb/lib/selenium/webdriver/firefox/binary.rb

### Parent

Object

### Methods

- ::new
- #cope_with_mac_strangeness
- #create_base_profile
- #execute
- #kill
- #pid
- #quit
- #start_with
- #wait

### Class/Module Index

Quicksearch

- Selenium
- Selenium::WebDriver
- Selenium::WebDriver::BridgeHelper
- Selenium::WebDriver::ChildProcess
- Selenium::WebDriver::ChildProcess::IronRubyProcess
- Selenium::WebDriver::ChildProcess::JRubyProcess
- Selenium::WebDriver::ChildProcess::WindowsProcess
- Selenium::WebDriver::Chrome
- Selenium::WebDriver::Chrome::Bridge
- Selenium::WebDriver::Chrome::CommandExecutor
- Selenium::WebDriver::Chrome::Launcher
- Selenium::WebDriver::Chrome::Launcher::MacOSXLauncher
- Selenium::WebDriver::Chrome::Launcher::UnixLauncher
- Selenium::WebDriver::Chrome::Launcher::WindowsLauncher
- Selenium::WebDriver::Driver
- Selenium::WebDriver::DriverExtensions
- Selenium::WebDriver::DriverExtensions::TakesScreenshot
- Selenium::WebDriver::Element
- Selenium::WebDriver::Error
- Selenium::WebDriver::Error::ElementNotDisplayedError
- Selenium::WebDriver::Error::ElementNotEnabledError
- Selenium::WebDriver::Error::ElementNotSelectableError
- Selenium::WebDriver::Error::ExpectedError
- Selenium::WebDriver::Error::IndexOutOfBoundsError
- Selenium::WebDriver::Error::InvalidCookieDomainError
- Selenium::WebDriver::Error::NoCollectionError
- Selenium::WebDriver::Error::NoScriptResultError
- Selenium::WebDriver::Error::NoStringError
- Selenium::WebDriver::Error::NoStringLengthError
- Selenium::WebDriver::Error::NoStringWrapperError
- Selenium::WebDriver::Error::NoSuchCollectionError
- Selenium::WebDriver::Error::NoSuchDocumentError
- Selenium::WebDriver::Error::NoSuchDriverError
- Selenium::WebDriver::Error::NoSuchElementError
- Selenium::WebDriver::Error::NoSuchFrameError
- Selenium::WebDriver::Error::NoSuchWindowError
- Selenium::WebDriver::Error::NullPointerError
- Selenium::WebDriver::Error::ObsoleteElementError
- Selenium::WebDriver::Error::ServerError
- Selenium::WebDriver::Error::TimeOutError
- Selenium::WebDriver::Error::UnableToSetCookieError
- Selenium::WebDriver::Error::UnexpectedJavascriptError
- Selenium::WebDriver::Error::UnhandledError
- Selenium::WebDriver::Error::UnknownCommandError
- Selenium::WebDriver::Error::UnknownScriptResultError
- Selenium::WebDriver::Error::UnsupportedOperationError
- Selenium::WebDriver::Error::WebDriverError
- Selenium::WebDriver::FileReaper
- Selenium::WebDriver::Find
- Selenium::WebDriver::Firefox
- Selenium::WebDriver::Firefox::Binary
- Selenium::WebDriver::Firefox::Bridge
- Selenium::WebDriver::Firefox::Launcher
- Selenium::WebDriver::Firefox::Profile
- Selenium::WebDriver::Firefox::ProfilesIni
- Selenium::WebDriver::Firefox::Util
- Selenium::WebDriver::IE
- Selenium::WebDriver::IE::Bridge
- Selenium::WebDriver::IE::Kernel32
- Selenium::WebDriver::IE::Lib
- Selenium::WebDriver::IE::Util
- Selenium::WebDriver::Keys
- Selenium::WebDriver::Navigation
- Selenium::WebDriver::Options
- Selenium::WebDriver::Platform
- Selenium::WebDriver::Remote
- Selenium::WebDriver::Remote::Bridge
- Selenium::WebDriver::Remote::Capabilities
- Selenium::WebDriver::Remote::Http
- Selenium::WebDriver::Remote::Http::Common
- Selenium::WebDriver::Remote::Http::Curb
- Selenium::WebDriver::Remote::Http::Default
- Selenium::WebDriver::Remote::Response
- Selenium::WebDriver::TargetLocator
- Selenium::WebDriver::Timeouts
- Dir
- SocketError
- String

No matching classes.

# 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.