Class: Selenium::WebDriver::Chrome::Launcher::WindowsLauncher

Inherits:
Selenium::WebDriver::Chrome::Launcher show all
Defined in:
lib/selenium/webdriver/chrome/launcher.rb

Instance Attribute Summary

Attributes inherited from Selenium::WebDriver::Chrome::Launcher

#pid

Class Method Summary collapse

Methods inherited from Selenium::WebDriver::Chrome::Launcher

binary_path, binary_path=, #initialize, #launch, launcher, #quit

Constructor Details

This class inherits a constructor from Selenium::WebDriver::Chrome::Launcher

Class Method Details

.possible_pathsObject



123
124
125
126
127
128
129
130
131
# File 'lib/selenium/webdriver/chrome/launcher.rb', line 123

def self.possible_paths
  [
    registry_path,
    "#{ENV['USERPROFILE']}\\Local Settings\\Application Data\\Google\\Chrome\\Application\\chrome.exe",
    "#{ENV['USERPROFILE']}\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe",
    "#{Platform.home}\\Local Settings\\Application Data\\Google\\Chrome\\Application\\chrome.exe",
    "#{Platform.home}\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe",
  ].compact
end

.registry_pathObject



133
134
135
136
137
138
139
140
141
142
143
# File 'lib/selenium/webdriver/chrome/launcher.rb', line 133

def self.registry_path
  require "win32/registry"

  reg = Win32::Registry::HKEY_LOCAL_MACHINE.open("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\chrome.exe")
  reg[""]
rescue LoadError
  # older JRuby and IronRuby does not have win32/registry
  nil
rescue Win32::Registry::Error
  nil
end