Python Selenium:首先摆脱 Firefox 运行 屏幕
Python Selenium: getting rid of Firefox first run screen
目前我的 py.test + splinter + pytest-splinter 测试会在创建浏览器实例时加载 Firefox 欢迎屏幕:
如何摆脱这个问题并把 about:blank
作为起始页,因为这个屏幕在每次测试中都浪费了一些时间和带宽 运行?
将startup.homepage_welcome_url.additional
属性设置为''
:
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)
目前我的 py.test + splinter + pytest-splinter 测试会在创建浏览器实例时加载 Firefox 欢迎屏幕:
如何摆脱这个问题并把 about:blank
作为起始页,因为这个屏幕在每次测试中都浪费了一些时间和带宽 运行?
将startup.homepage_welcome_url.additional
属性设置为''
:
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)