To use Chrome, ensure you’re using the appropriate driver

Starting Chrome

Chrome is the default, so you don’t even have to specify it unless you need to add capabilities.

b =
b = :chrome, opts


Chrome has a new headless feature that can be accessed directly with:

b = :chrome, headless: true

It is still under active development so not all features work yet (alerts, window switching, etc)

Chrome Options

The options hash can be created with the following parameters:

  • :args - an Array of command-line arguments to use when starting Chrome
  • :binary - a String representing the Path to the Chrome Browser executable to use
  • :prefs - a Hash with each entry consisting of the name of the preference and its value
  • :extensions - an Array of Strings listing the paths to (.crx) Chrome extensions to install on startup
  • :options - a Hash for raw options
  • :emulation - A Hash for raw emulation options


Information on configuring preferences can be found here

prefs = {
  download: {
    prompt_for_download: false,
    default_directory: '/path/to/dir'

b = :chrome, options: {prefs: prefs}


See the full list of switches here

args = ['--ignore-certificate-errors', '--disable-popup-blocking', '--disable-translate']
b = :chrome, options: {args: args}

Raw Options

See the full list of options here

b = :chrome, options: {options: {detach: true}}

Using chrome on Heroku

You can drive the chrome browser on heroku with a cedar-14 stack. Check out this sample repo for more information on how to do this:

You can also run using a headless chrome on the heroku-16 stack. Here’s an example of that working:

Last Updated: August 10, 2018