Skip to content
This repository

Using Watai with Google Chrome

To test with Chrome, you will need to install another utility, chromedriver, to bridge the Selenium server to Google Chrome.

Benefits

  1. Much faster browser start than Firefox, and faster browsing mean faster tests.
  2. Obviously, testing on Chrome, a rather common browser ;)

Installation

Under OS X with Homebrew

brew install chromedriver

Others

  1. Download the proper precompiled version for your platform from ChromeDriver’s downloads.
  2. Make the downloaded file executable (chmod a+x path/to/chromedriver).
  3. Place the downloaded executable in your PATH (mv path/to/chromedriver /usr/local/bin for example, for Unices), or set the webdriver.chrome.driver system property to the path of the executable.

Choosing Chrome as the target browser

Edit the config of your Watai test suite.

You will have to set the browser key (or the browserName key of the driverCapabilities hash) to "chrome". If your Chrome browser is not in its default installation location (i.e. you moved it after having installed it), you will also need to give the path to its binary in the 'chrome.binary' key of the driverCapabilities hash.

// config.json
{
    "baseURL": "http://127.0.0.1:3000",
    "browser": "chrome"
}

Limitations

Runaway processes

Even though Watai does its best to clean up after itself, there may be cases where the chromedriver process is not killed properly. After a set of testing sessions, you should therefore make sure no runaway processes are left, with killall chromedriver, for example.

Something went wrong with that request. Please try again.