FirefoxDriver always starts on the "firstrun" page, breaking all test scripts

Starting just last night, FirefoxDriver always opened on this page: https://www.mozilla.org/en-US/firefox/42.0/firstrun/learnmore/ . I tried changing the default profile settings and had no success.

The next question, http://stackoverflow.com/questions/33937067/firefox-webdriver-opens-first-run-page-all-the-time , is similar, but I don’t see where to implement the four lines of code, and my personal attempts throwing it into my scripts turned out to be useless.

This problem started quite unexpectedly last night. Today I have presentations, and I can not get any of my scripts to work.

Running an instance of my WebDriver instance, for example, raises a NoSuchMethodError:

  FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("browser.startup.homepage", "about:blank"); profile.setPreference("startup.homepage_welcome_url", "about:blank"); profile.setPreference("startup.homepage_welcome_url.additional", "about:blank"); driver = new FirefoxDriver(profile); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); 

But getting rid of the profile in FirefoxDriver returns it to the first page above.

+6
source share
4 answers

Go to the profile manager using "Firefox.exe - p"

You will have more than one profile. Select the default profile and make it the default all the time.

You should not open this page. I tested and it works great.

You can try this code. I am sure this will work.

  ProfilesIni profile = new ProfilesIni(); FirefoxProfile ffprofile = profile.getProfile("default"); WebDriver driver = new FirefoxDriver(ffprofile); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); 
+2
source

I had this problem when running RSpec / Capybara tests using Selenium Webdriver and Poltergeist with Firefox as a browser for a Rails application. I tried reconfiguring Firefox in different ways to no avail, but managed to fix it by simply updating the selenium-webdriver stone in my Gemfile ( gem 'selenium-webdriver' ):

bundle update selenium-webdriver

Credit goes to @lucetzer

+11
source

I had the same problem with the first launch page, after some searches, I found that this worked for me (I use WebDriver 2.53.0 and FF 45.0.1):

 FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("browser.startup.homepage_override.mstone", "ignore"); profile.setPreference("startup.homepage_welcome_url", "about:blank"); profile.setPreference("startup.homepage_welcome_url.additional","about:blank"); profile.setPreference("browser.startup.homepage","about:blank"); WebDriver driver = new FirefoxDriver(profile); 
+3
source

There is a problem with certificates in the first splash screen to launch the Mozilla homepage. I filed a ticket for this at Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1269500

To fix this problem in Selenium / Capybara / Cucumber, we need to change the default homepage for new profiles to a blank or another page. To do this, register the firefox / selenium driver in the configuration:

 Capybara.register_driver :firefox do |app| profile = Selenium::WebDriver::Firefox::Profile.new profile['browser.startup.homepage_override.mstone'] = 'ignore' profile['startup.homepage_welcome_url.additional'] = 'about:blank' Capybara::Selenium::Driver.new(app, :browser => :firefox, :profile => profile) end 
0
source

All Articles