Skip to content

Heroku buildpack google chrome

Lakshya Kapoor edited this page Jul 26, 2019 · 16 revisions

heroku-buildpack-google-chrome users need to use either of these options to help webdrivers find the custom install path to Google Chrome on Heroku. This is required so the gem can download the appropriate version of chromedriver.

Option 1: Set the WD_CHROME_PATH environment variable to whatever $GOOGLE_CHROME_SHIM points to.

$ echo $GOOGLE_CHROME_SHIM
=> /app/.apt/usr/bin/google-chrome-stable

$ RAILS_ENV=test bundle exec rake webdrivers:chromedriver:update WD_CHROME_PATH=/app/.apt/usr/bin/google-chrome-stable

Option 2: Set Selenium::WebDriver::Chrome.path (in your code) to whatever $GOOGLE_CHROME_SHIM points to.

require 'webdrivers'

Selenium::WebDriver::Chrome.path = ENV.fetch('GOOGLE_CHROME_SHIM', nil)
driver = Selenium::WebDriver.for :chrome

Source

https://github.com/titusfortner/webdrivers/issues/72

https://github.com/heroku/heroku-buildpack-google-chrome#selenium

Clone this wiki locally