Speci
Speci

Reputation: 374

How to disable password manager in chrome webdriver

I hope you are all having a good day.

I have been trying to disable the password manager bubble for the last 3 days now without any luck. The reeason why I want to disable it is because its interfeering with my selenium automation even though it's not supposed to. But since I don't need password manager for my automation I would like to disable it completely.

enter image description here

What I have tried so far

Below is a list with all the flags I could find related to password manager. Even after adding all of them it still shows the password manager.

'--credentials_enable_service=false '
'--profile.password_manager_enabled=false '
'--disable-save-password-bubble '
'--disable-fill-on-account-select '
'--fill-on-account-select=false '
'--username-first-flow-with-intermediate-values=false '
'--enable-show-autofill-signatures=false '
'--skip-undecryptable-passwords=false '
'--force-password-initial-sync-when-decryption-fails=false '
'--fill-on-account-select=false '
'--filling-across-grouped-sites=false '
'--ios-promo-password-bubble=false '
'--password-generation-experiment=false '
'--revamped-password-management-bubble=false '
'--passwords-import-m2=false '
'--forgot-password-form-support=false '
'--password-store=basic'

I have also looked at other similar questions in stackoverflow but they seem to be outdated with the new Chrome updates since all the flags that used to work are not even available anymore in Chrome.

chrome_opt = webdriver.ChromeOptions()

prefs = {
     "credentials_enable_service": False,
     "profile.password_manager_enabled": False
}

chrome_opt.add_experimental_option("prefs", prefs)

driver = webdriver.Chrome(chrome_options=chrome_opt, executable_path=r'C:\chrome_path.exe')

I have also found a solution that inlolves modifying some values Window registry of Chrome that disables password manager completely but that's not optimal because it will also disable the password manager from my normal Chrome build.

Thanks everyone for your time :)

PS: Don't give me the: "This have been answered before." I have tried everything and nothing works anymore. I am looking for an up to date solution.

Upvotes: 5

Views: 2906

Answers (3)

350D
350D

Reputation: 11449

To disable Chromium's password manager, create a proper profile folder with a file named Preferences (without extension) in a subdirectory like Default, and add "password_manager_enabled": false under "profile". Then launch Chromium with appropriate flags --user-data-dir and --profile-directory="Default" to use that profile.

"profile": {
    "password_manager_enabled": false
}

Upvotes: 0

Yaroslavm
Yaroslavm

Reputation: 4804

You can hide password manager, using @Michael Mintz suggestion, or you can create Profile for automation and turn off password manager in it. It's more time consuming operation, however, in profile you can easily turn on / off lots of another features by demand.

  1. Create new profile in Chrome
  2. Click on profile icon -> Click on key icon
  3. Turn off checkbox `Offer to save passwords"
  4. Locate your new Chrome profile directory (for example, on Mac it is /Users/YourUser/Library/Application Support/Google/Chrome/
  5. Create new directory UserData in Chrome catalog
  6. Copy your new profile inside this catalog
  7. Pass created profile inside ChromeOptions

How to turn off password manager in Chrome profile reference

How to correctly define Chrome profile reference

options = webdriver.ChromeOptions()
path = '/Users/YourUser/Library/Application Support/Google/Chrome/UserData'
options.add_argument(f"--user-data-dir={path}")
options.add_argument('--profile-directory=Profile 2')

Upvotes: 1

Michael Mintz
Michael Mintz

Reputation: 15556

If none of the options you tried above work for you, use --guest mode:

from selenium import webdriver

chrome_opt = webdriver.ChromeOptions()
chrome_opt.add_argument("--guest")
driver = webdriver.Chrome(chrome_options=chrome_opt)

If you try going to chrome://password-manager/passwords in Guest Mode, you'll see: "Password Manager is not available to Guest users".

Upvotes: 6

Related Questions