I use WebDriver Java bindings. Creating a FirefoxDriver instance launches the Firefox browser with the 'firstrun' page: https://www.mozilla.org/en-US/firefox/42.0/firstrun/learnmore/ . It takes some time to load this page.
I want Firefox to start from "about:blank" to make the initialization faster. For Internet Explorer this can be done by:
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(InternetExplorerDriver.INITIAL_BROWSER_URL, "about:blank");
new InternetExplorerDriver(cap);
How to do the same for Firefox and Chrome?
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");
WebDriver driver = new FirefoxDriver(profile);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With