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 professionals since 2007

Our laser focus on a single technology has made us a leader in this space. Need help?

  • We build a solid first version of your product
  • We train your development team
  • We rescue your project in trouble
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)