When navigating to a new page via URL, by default Selenium will wait until the page has fully loaded before responding. This works well for beginners, but can cause long wait times on pages that load a large number of third party resources. Using a non default strategy can make test execution faster in cases like this, but can also introduce flakiness where elements on the page change position as elements load in and change size.
The page load strategy queries the document.readyState as described in the table below:
|normal||complete||Used by default, waits for all resources to download|
|eager||interactive||DOM access is ready, but other resources like images may still be loading|
|none||Any||Does not block WebDriver at all|
FirefoxOptions is the new way to define capabilities for the Firefox browser and should generally be used in preference to DesiredCapabilities.
FirefoxOptions options = new FirefoxOptions(); options.addPreference("network.proxy.type", 0); driver = new RemoteWebDriver(options);
It is possible to create a custom profile for Firefox as demonstrated below.
FirefoxProfile profile = new FirefoxProfile(); FirefoxOptions options = new FirefoxOptions(); options.setProfile(profile); driver = new RemoteWebDriver(options);
In some environments, Internet Explorer may timeout when opening the File Upload dialog. IEDriver has a default timeout of 1000ms, but you can increase the timeout using the fileUploadDialogTimeout capability.