The Next Generation Platform is Coming - Get Ready Now!
by heroku
GitHub Readme.md
This buildpack installs Google Chrome browser chrome
& chromedriver
, the Selenium driver for Chrome, in a Heroku app.
In summer 2023, the Chrome development team addressed a long-standing problem with keeping Chrome & Chromedriver versions updated and aligned with each other for automated testing environments. This buildpack follows this strategy to keep chrome
& chromedriver
versions in-sync.
Important
If migrating from a previous Chrome-chromedriver installation, then remove any pre-existing Chrome or Chromedriver buildpacks from the app. See the migration guide.
heroku buildpacks:add -i 1 heroku-community/chrome-for-testing
Deploy the app to install Chrome for Testing. 🚀
By default, this buildpack will download the latest Stable
release, which is provided
by Google.
You can control the channel of the release by setting the GOOGLE_CHROME_CHANNEL
config variable to Stable
, Beta
, Dev
, or Canary
, and then deploy/build the app.
When an app already uses the separate Chrome & Chromedriver buildpacks, remove them from the app, before adding this one:
heroku buildpacks:remove heroku/google-chrome
heroku buildpacks:remove heroku/chromedriver
heroku buildpacks:add -i 1 heroku-community/chrome-for-testing
After being installed by this buildpack, chrome
& chromedriver
are set in the PATH
of dynos.
If the absolute paths are required, you can discover their location in an app:
>>> heroku run bash
$ which chrome
/app/.chrome-for-testing/chrome-linux64/chrome
$ which chromedriver
/app/.chrome-for-testing/chromedriver-linux64/chromedriver
These locations may change in future versions of this buildpack, so please allow the operating system to resolve their locations from PATH
, if possible.
The prior heroku/google-chrome
buildpack wrapped the chrome
command with default flags using a shim script. This is no longer implemented for chrome
in this buildpack, to support evolving changes to the Chrome for Testing flags, such as the --headless=new variation.
Depending on how an app is already setup for testing with Chrome, it may not require any changes.
If the app fails to start Chrome, please ensure that the following argument flags are set wherever chrome
is invoked:
--headless
--no-sandbox
Some use-cases may require these flags too:
--disable-gpu
--remote-debugging-port=9222
For buildpack maintainers only.
Copy the snippet above into CLI.
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.