Firefox webdriver opens first run page all the time

前端 未结 8 2226
醉梦人生
醉梦人生 2020-12-03 04:09

How to disable this \"first run\" page once and for all for FF?

When FF driver is created, it opens tab with - https://www.mozilla.org/en-US/firefox/42.0/firstrun/le

8条回答
  •  温柔的废话
    2020-12-03 05:00

    If you using selenium webdriver from Capybara/Cucumber, then you can change the default url when you register your driver using startup.homepage_welcome_url.additional:

    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
    

提交回复
热议问题