Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locate Chrome the same way as Google #45

Closed
titusfortner opened this issue Mar 26, 2019 · 4 comments · Fixed by #105
Closed

Locate Chrome the same way as Google #45

titusfortner opened this issue Mar 26, 2019 · 4 comments · Fixed by #105
Assignees
Milestone

Comments

@titusfortner
Copy link
Owner

Here is Google's code for how they get the default browser.
https://cs.chromium.org/chromium/src/chrome/test/chromedriver/chrome/chrome_finder.cc
This won't be an issue in 99% of cases, but it is possible that the webdrivers method and the chromedriver method can each get different information resulting in the wrong driver being used.

@blerner
Copy link

blerner commented May 6, 2019

I think this issue pops up in more than 1% of cases: if I'm understanding correctly, then any Linux machine that has only Chromium installed but not Chrome, will wind up triggering the symptoms shown in #67. This doesn't seem like too implausible a configuration... As in #67, setting the path manually avoids the issue, but only on my machine: some of my colleagues have Chrome installed but not Chromium, and so the "fix" for me actually breaks things for them, which makes it annoyingly hard to get consistent test run behavior.

@titusfortner
Copy link
Owner Author

@blerner To clarify, you are saying that Chromedriver itself picks the correct browser on the system, but webdrivers gem does not?

@blerner
Copy link

blerner commented May 6, 2019

Until earlier today, I was using the gems capybara, capybara-webkit, selenium-webdriver, and chromedriver-helper, I set Capybara.default_driver = :selenium_chrome_headless, and everything worked fine. Today I saw the deprecation notice for chromedriver-helper, and that the recommended update was to webdrivers. So I replaced selenium-webdriver and chromedriver-helper with webdrivers, and everything broke. Then I set the Selenium::WebDriver::Chrome.path, and things worked again. That's the entirety of my current git diff relative to this morning.

If I'm doing something stupid, I'm happy to fix it. But as far as I can tell, yes: chromedriver worked with Chromium, and webdrivers does not.

@titusfortner
Copy link
Owner Author

No, the issue is that with later versions of chrome you need to match the driver version to the browser version. So a driver manager needs to know the browser version to ensure correct driver version. Webdrivers is currently just looking for google-chrome and just looking on PATH. Just looked at the chromedriver code again, it isn't even looking on PATH, and looks for a bunch of different things.

I don't want people to have to specify their browser location. We need to do more, even if we don't get it exactly the same. I'll add this as a requirement for 4.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants