Configuring Chrome settings when running Watir-Webdriver

I recently found the need to ignore certificate errors when running Watir-Webdriver tests in Google Chrome. The way to do this is slightly different from doing it in Firefox. Unlike Firefox where you create capabilities and profiles, in Google Chrome you pass arguments to Chrome to enable/disable certain browser features.

For example: to ignore certificate errors, disable pop-ups, disable translate and specify a proxy you do:

b = :chrome, :switches => %w[--ignore-certificate-errors --disable-popup-blocking --disable-translate]

NB: The %W[] converts a long string (separated by spaces) into an array of strings.

The full list of these options is available here. Thanks again to Jari Bakken for pointing me in the right direction.

Author: Alister Scott

Alister is an Excellence Wrangler for Automattic.