Driver specific capabilities

Firefox

Define Capabilities using FirefoxOptions

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);
  

from selenium.webdriver.firefox.options import Options
options = Options()
options.headless = True
driver = webdriver.Firefox(options=options)
  

var options = new FirefoxOptions();
options.Proxy.Kind = ProxyKind.Direct;
var driver = new FirefoxDriver(options);
  

# We don't have a Ruby code sample yet -  Help us out and raise a PR
  

// We don't have a JavaScript code sample yet -  Help us out and raise a PR  
  

val options = new FirefoxOptions()
options.addPreference("network.proxy.type", 0)
driver = RemoteWebDriver(options)
  

Setting a custom profile

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);
  

from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
options=Options()
firefox_profile = FirefoxProfile()
firefox_profile.set_preference("javascript.enabled", False)
options.profile = firefox_profile
  

var options = new FirefoxOptions();
var profile = new FirefoxProfile();
options.Profile = profile;
var driver = new RemoteWebDriver(options);
  

# We don't have a Ruby code sample yet -  Help us out and raise a PR
  

// We don't have a JavaScript code sample yet -  Help us out and raise a PR  
  

val options = FirefoxOptions()
options.profile = FirefoxProfile()
driver = RemoteWebDriver(options)
  

Internet Explorer

fileUploadDialogTimeout

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.


// We don't have a Java code sample yet -  Help us out and raise a PR  
  

# We don't have a Python code sample yet -  Help us out and raise a PR
  

var options = new InternetExplorerOptions();
options.FileUploadDialogTimeout = TimeSpan.FromMilliseconds(2000);
var driver = new RemoteWebDriver(options);
  

# We don't have a Ruby code sample yet -  Help us out and raise a PR
  

// We don't have a JavaScript code sample yet -  Help us out and raise a PR