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

Instance Method Summary collapse

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

binary_path, #initialize, #launch, launcher

Constructor Details

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

Class Method Details

.possible_pathsObject



118
119
120
121
122
123
124
125
126
# File 'lib/selenium/webdriver/chrome/launcher.rb', line 118

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



128
129
130
131
132
133
134
135
136
137
138
# File 'lib/selenium/webdriver/chrome/launcher.rb', line 128

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

Instance Method Details

#quitObject



140
141
142
143
144
# File 'lib/selenium/webdriver/chrome/launcher.rb', line 140

def quit
  # looks like we need a kill right away on Windows + MRI
  @process.kill if Platform.engine == :ruby
  super
end