Search code examples
pythonfirefoxseleniumpytestsplinter

Python Selenium: getting rid of Firefox first run screen


Currently my py.test + splinter + pytest-splinter tests load a Firefox welcome screen when browser instance is created:

enter image description here

How one can get rid of this and have about:blank as a starting page as this screen is wasting some time and bandwidth on each test run?


Solution

  • Set startup.homepage_welcome_url.additional property to '':

    In [1]: from selenium import webdriver
    
    In [2]: profile = webdriver.FirefoxProfile()
    
    In [3]: profile.set_preference('startup.homepage_welcome_url.additional', '')
    
    In [4]: browser = webdriver.Firefox(profile)