Firefox's "this connection is not secured" pop-up error.

46 views
Skip to first unread message

ass...@centerity.com

unread,
May 22, 2017, 8:06:33 AM5/22/17
to Selenium Users
In the log-in screen (and some other random places), Firefox is warning me not to feed secure information. He's right, but that's not the point. I DO need to automate the login phase to a dependable level, and having this message randomly popping up (well, probably the "randomness" is precise timing issues) - well, it's failing my tests.

What happens is that instead of clicking "login", the popup from Firefox is clicked, resulting in, well, failure.

The solution is apparently easy. Disable the "security.insecure_field_warning.contextual.enabled" key.
However, I disabled it a few times already, and Firefox keeps forgetting that.

Is there any way to instruct Selenium to ignore this nasty little popup?

Many thanks in advance,
Assaf.
Login.png

Shawn McCarthy

unread,
May 22, 2017, 2:47:09 PM5/22/17
to Selenium Users
Selenium doesn't use your existing firefox profile unless you tell it to. That is why saving the option manually is not doing anything for you. Try this :
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("security.insecure_field_warning.contextual.enabled", false);
driver = new FirefoxDriver(profile);

Andreas Tolfsen

unread,
May 24, 2017, 10:38:51 AM5/24/17
to seleniu...@googlegroups.com
Also sprach Shawn McCarthy:

> Selenium doesn't use your existing firefox profile unless you tell it
> to. That is why saving the option manually is not doing anything for
> you. Try this :
>
> FirefoxProfile profile = new FirefoxProfile();
> profile.setPreference("security.insecure_field_warning.contextual.enabled", false <http://www.google.com>);
> driver = new FirefoxDriver(profile);

It would be significantly more performant to pass this preference in as
part of the moz:firefoxOptions dictionary:

{"capabilities":
{"desiredCapabilities":
{"moz:firefoxOptions":
{"prefs": [{"security.insecure_field_warning.contextual.enabled": false}]}
}
}
}
Reply all
Reply to author
Forward
0 new messages