How to disable or close “Change your password” popup after login

155 views
Skip to first unread message

ליאור שטרנברג

unread,
May 16, 2024, 10:14:33 AMMay 16
to Selenium Users

 

Hi All

I’m working on Selenium through Java 17.

Selenium version: 4.20.0

Chrome version: 125.0.6422.61

 

From Chrome 124, I got “change your password” popup, for some sites that I test.

The page is not interactable until I close this popup.(see picture below)

 

I use the follow preferences for the chrome driver

Map<String, Object> prefs = new HashMap<String, Object>();
prefs.put("safebrowsing.enabled", true);
prefs.put("credentials_enable_service", false);
prefs.put("profile.password_manager_enabled", false);

 

 

The only thing that success to disable this popup is to set  safebrowsing.enabled preference to false.

But than some downloads are blocked for me, due to it required safebrowsing.

 

The only thing that worked at Selenium 3 is to click Esc in the Keyboard class. But it’s not supported in Selenium4.

for example: (Keyboard keyBoard = ((HasInputDevices) driver).getKeyboard() )

 

Press Esc with Actions does not close the popup.

for Example: Actions(driver).keyDown(key).keyUp(key).perform();

 (I tried also with Robots, and it didn’t success as well)

 

Is there a way to disable the “Warn you if a password was compromised in a data breach” by Selenium (see picture below)?

Is there a way to click Esc on the browser, that it will success like the Keyboard class, in Selenium 4?

 

Thanks in Advanced

Lior

dataBreachSettings.png
popup.png

Rami AbuGhazaleh

unread,
May 24, 2024, 11:25:27 PMMay 24
to Selenium Users
I discovered that if you run Chrome as "guest" the dialog does not appear.
For example, `chromeOptions.AddArgument("guest");`

However, when running as "guest", I cannot set "safebrowsing-disable-download-protection" to disable the "Save As" download dialog.
For example, `chromeOptions.AddUserProfilePreference("safebrowsing-disable-download-protection", null);`

Rami AbuGhazaleh

unread,
May 24, 2024, 11:25:27 PMMay 24
to Selenium Users
I figured it out.

Using "reduce-security-for-testing" resolves the issue.

For example, in C#, `chromeOptions.AddUserProfilePreference("reduce-security-for-testing", null);`

On Thursday, May 16, 2024 at 7:14:33 AM UTC-7 lior...@gmail.com wrote:

Rami AbuGhazaleh

unread,
May 24, 2024, 11:25:27 PMMay 24
to Selenium Users

Rami AbuGhazaleh

unread,
May 24, 2024, 11:25:27 PMMay 24
to Selenium Users
Actually, I discovered it to be `--disable-infobars`.

For example, in C# `chromeOptions.AddArgument("--disable-infobars");`

I don't know if this has any side-effects.

Rami AbuGhazaleh

unread,
May 24, 2024, 11:25:32 PMMay 24
to Selenium Users
It's definitely inconsistent.

In the end, I had to use three settings:

1. --password-store=basic

For example, in C#:
`chromeOptions.AddArgument("password-store=basic");`

2. credentials_enable_service=false

For example, in C#:
`chromeOptions.AddUserProfilePreference("credentials_enable_service", false);`

3. profile.password_manager_enabled=false

For example, in C#:
`chromeOptions.AddUserProfilePreference("profile.password_manager_enabled", false);`

Tested on Windows 10
Chrome 125.0.6422.77 and 125.0.6422.113 just now
ChromeDriver 125.0.6422.76


On Thursday, May 16, 2024 at 7:14:33 AM UTC-7 lior...@gmail.com wrote:

Rami AbuGhazaleh

unread,
May 25, 2024, 3:35:16 AMMay 25
to Selenium Users
The only ways I could get this to work is by using guest mode or incognito mode.

But then the "Save As" dialog appears when download files, which is unexpected.


If you aren't downloading files, then those options may work for you.

Rami AbuGhazaleh

unread,
May 25, 2024, 7:29:12 AMMay 25
to Selenium Users

`chromePrefs.put("profile.password_manager_leak_detection", false);`
Reply all
Reply to author
Forward
0 new messages