How to get around the firefox update page when using Selenium?

I have several selenium tests running in a Firefox browser. unfortunately, although I will take care of creating a new profile, I always have the /firstrun/ page for Firefox, which appears when my test starts, which is rather annoying since this page receives content over the Internet.

I tried to disable it as follows

  FirefoxProfile profile = new FirefoxProfile(profileDir); if(!exists) { profile.setPreference("signed.applets.codebase_principal_support", true); profile.setPreference("capability.principal.codebase.p0.granted", true); profile.setPreference("startup.homepage_override_url", "about:blank"); profile.setPreference("browser.startup.homepage_override.mstone", "'ignore'"); 

but he shows up.

What can I do to make Firefox start with the page shown?

+5
source share
1 answer

Cyril asks the right question: β€œWhy single quotes?”. Without it, it works for me.

  profile.setPreference("browser.startup.homepage_override.mstone", "ignore"); 

An alternative approach is to load a blank page after creating an instance of Firefox (driver.get ("about: blank");)

+1
source

Source: https://habr.com/ru/post/1237169/


All Articles