titusfortner / webdrivers

Keep your Selenium WebDrivers updated automatically
MIT License
593 stars 111 forks source link

Finding Chrome binary issue #205

Closed ericramsey-bread closed 3 years ago

ericramsey-bread commented 3 years ago

Summary

With Chrome's new way of installing/updating chrome after version 85, the Webdrivers gem is failing to find the binary when chrome is installed on a 64bit machine. Within Google's new approach of installing chrome if you are installing a fresh version of chrome onto a 64bit machine they create a folder in both 'Program Files' and 'Program Files (x86)' the binary is only placed in the 'Program Files' area where as other elements are placed in the 'Program Files (x86)' area. If you had Chrome installed on a 64bit machine before version 85 then Google just leave all information/files in the 'Program Files (x86)' area.

Without an update for this searching of where Google is installed, the end user will just get the 'Failed to find Chrome binary.' error message

Debug Info

Please provide the following information for bug reports:

Expected Behavior

Expect the Chrome binary to be found for version greater than 85

Actual Behavior

Receiving the 'Failed to find Chrome binary.' error message even though Chrome is installed in the 'C:\Program Files\Google\Chrome\Application' folder

kapoorlakshya commented 3 years ago

@ericramsey I am unable to reproduce the error. I performed a clean install of Chrome v88 on Windows 10 64-bit and webdrivers v4.5.0 is still able to find the binary in Program Files and return the version:

irb(main):001:0> require 'webdrivers'
=> true
irb(main):002:0> Webdrivers::ChromeFinder.location
=> "C:\\Program Files\\\\Google\\Chrome\\Application\\chrome.exe"
irb(main):004:0> Webdrivers::Chromedriver.browser_version
=> #<Gem::Version "88.0.4324.150">

The logic to find the binary lives here, which includes both Program Files and ProgramFiles (x86) on line 39:

https://github.com/titusfortner/webdrivers/blob/6eb6027f6258a9fd3a60a79c122ac1fbf7cc6a37/lib/webdrivers/chrome_finder.rb#L38-L51

I would recommend upgrading to Chrome 88 and see if you can still reproduce this.

ericramsey-bread commented 3 years ago

After updating to Chrome version 88, the gem is working as expected. thank you for the help.