titusfortner / webdrivers

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

Chrome binary cannot be located on Windows (JRuby) #130

Closed joankaradimov closed 5 years ago

joankaradimov commented 5 years ago

Summary

The binary for Chrome cannot be found on Windows. It looks like it might be because of a whitespace in its path.

Debug Info

Expected Behavior

No exception is thrown.

Actual Behavior

This exception is thrown:

x86 : The term 'x86' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:37
+ (Get-ItemProperty C:\Program Files (x86)\\Google\Chrome\Application\c ...
+                                     ~~~
    + CategoryInfo          : ObjectNotFound: (x86:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

An error occurred in a `before(:suite)` hook.
Failure/Error: raise VersionError, 'Failed to find Chrome binary or its version.' if version.nil? || version.empty?

Webdrivers::VersionError:
  Failed to find Chrome binary or its version.
# ./features/build/tmp/jrubyExec/gems/webdrivers-4.0.0/lib/webdrivers/chrome_finder.rb:10:in `version'
# ./features/build/tmp/jrubyExec/gems/webdrivers-4.0.0/lib/webdrivers/chromedriver.rb:46:in `chrome_version'
# ./features/build/tmp/jrubyExec/gems/webdrivers-4.0.0/lib/webdrivers/chromedriver.rb:105:in `release_version'
# ./features/build/tmp/jrubyExec/gems/webdrivers-4.0.0/lib/webdrivers/chromedriver.rb:111:in `sufficient_binary?'
# ./features/build/tmp/jrubyExec/gems/webdrivers-4.0.0/lib/webdrivers/common.rb:132:in `correct_binary?'
# ./features/build/tmp/jrubyExec/gems/webdrivers-4.0.0/lib/webdrivers/common.rb:83:in `update'
# ./features/build/tmp/jrubyExec/gems/webdrivers-4.0.0/lib/webdrivers/chromedriver.rb:118:in `block in <main>'
# ./features/build/tmp/jrubyExec/gems/selenium-webdriver-3.142.3/lib/selenium/webdriver/common/service.rb:133:in `binary_path'
# ./features/build/tmp/jrubyExec/gems/selenium-webdriver-3.142.3/lib/selenium/webdriver/common/service.rb:94:in `initialize'
# ./features/build/tmp/jrubyExec/gems/selenium-webdriver-3.142.3/lib/selenium/webdriver/common/service.rb:41:in `chrome'
# ./features/build/tmp/jrubyExec/gems/selenium-webdriver-3.142.3/lib/selenium/webdriver/common/driver.rb:299:in `service_url'
# ./features/build/tmp/jrubyExec/gems/selenium-webdriver-3.142.3/lib/selenium/webdriver/chrome/driver.rb:40:in `initialize'
# ./features/build/tmp/jrubyExec/gems/selenium-webdriver-3.142.3/lib/selenium/webdriver/common/driver.rb:46:in `for'
# ./features/build/tmp/jrubyExec/gems/selenium-webdriver-3.142.3/lib/selenium/webdriver.rb:88:in `for'
# ./features/build/tmp/jrubyExec/gems/capybara-3.22.0/lib/capybara/selenium/driver.rb:48:in `browser'
# ./features/build/tmp/jrubyExec/gems/capybara-3.22.0/lib/capybara/selenium/driver.rb:167:in `current_window_handle'
# ./features/build/tmp/jrubyExec/gems/capybara-3.22.0/lib/capybara/session.rb:437:in `current_window'
# ./features/spec_helper.rb:89:in `block in <main>'
# ------------------
# --- Caused by: ---
# Webdrivers::VersionError:
#   Failed to find Chrome binary or its version.
#   ./features/build/tmp/jrubyExec/gems/webdrivers-4.0.0/lib/webdrivers/chrome_finder.rb:10:in `version'
kapoorlakshya commented 5 years ago

Possibly related to #41 and https://github.com/jruby/jruby/issues/3725.

kapoorlakshya commented 5 years ago

Hi @joankaradimov, can you please test the fix from master in your project and confirm that it works for you? Thanks!

kapoorlakshya commented 5 years ago

Fix released in v4.0.1.

joankaradimov commented 5 years ago

Sorry for the big delay. Yes, I can confirm it is fixed.