Module: Selenium::WebDriver::Safari

Defined in:
lib/selenium/webdriver/safari.rb,
lib/selenium/webdriver/safari/bridge.rb,
lib/selenium/webdriver/safari/server.rb,
lib/selenium/webdriver/safari/browser.rb

Defined Under Namespace

Classes: Bridge, Browser, Server

Class Method Summary collapse

Class Method Details

.pathObject


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

def path
  @path ||= (
    path = case Platform.os
    when :windows
      # TODO: improve this
      File.join(ENV['ProgramFiles'], 'Safari', 'Safari.exe')
    when :macosx
      "/Applications/Safari.app/Contents/MacOS/Safari"
    else
      Platform.find_binary("Safari")
    end

    unless File.file?(path) && File.executable?(path)
      raise Error::WebDriverError, "unable to find the Safari executable, please set Selenium::WebDriver::Safari.path= or add it to your PATH."
    end

    path
  )
end

.path=(path) ⇒ Object


8
9
10
11
# File 'lib/selenium/webdriver/safari.rb', line 8

def path=(path)
  Platform.assert_executable(path)
  @path = path
end