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

Example Ruby in README code is out of date #139

Open
xaviershay opened this issue Apr 21, 2023 · 0 comments
Open

Example Ruby in README code is out of date #139

xaviershay opened this issue Apr 21, 2023 · 0 comments

Comments

@xaviershay
Copy link

I'm not sure what the correct way to do it is now, but the following appears to work for me (noting the redundant setting of path). Loathe to submit a PR when I don't actually understand how it all works...

chrome_bin = ENV.fetch('GOOGLE_CHROME_SHIM', nil)

options = Selenium::WebDriver::Chrome::Options.new
# ... I don't think this does anything
options.binary = chrome_bin if chrome_bin

# Discovered this by spelunking in the webdrivers code. I'm not really sure
# how all these gems interact...
Selenium::WebDriver::Chrome.path = chrome_bin

# Comment out for debugging
options.add_argument('--headless')

Capybara.register_driver :chrome do |app|
  Capybara::Selenium::Driver.new(
     app,
     browser: :chrome,
     options: options
  )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant