Read more

How to disable Chrome's save password bubble for Selenium tests

Arne Hartherz
April 26, 2017Software engineer at makandra GmbH

This is no longer relevant for current versions of Chrome/Chromium.
Password manager features are disabled when the "Chrome is being controlled by automated software" banner is shown.

When filling out forms in Selenium tests, Chrome shows the (usual) bubble, asking to store those credentials.

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

While the bubble does not interfere with tests, it is annoying when debugging tests. Here are two ways to disable it:

Option 1: prefs

You can set profile preferences to disable the password manager like so:

prefs = {
  'credentials_enable_service' => false,
  'profile.password_manager_enabled' => false
}

Capybara::Selenium::Driver.new(app, browser: :chrome, prefs: prefs)

Sadly, there are no command line switches for this.

Option 2: Incognito mode

Alternatively, use Incognito mode to make the bubble go away.

Capybara::Selenium::Driver.new(app, browser: :chrome, args: %w[--incognito])

Note that Incognito mode may have other impacts.

Posted by Arne Hartherz to makandra dev (2017-04-26 13:44)