The Desired Capabilities implementation.

class selenium.webdriver.common.desired_capabilities.DesiredCapabilities[source]

Set of default supported desired capabilities.

Use this as a starting point for creating a desired capabilities object for requesting remote webdrivers for connecting to selenium server or selenium grid.

Usage Example:

from selenium import webdriver

selenium_grid_url = ""

# Create a desired capabilities object as a starting point.
capabilities = DesiredCapabilities.FIREFOX.copy()
capabilities['platform'] = "WINDOWS"
capabilities['version'] = "10"

# Instantiate an instance of Remote WebDriver with the desired capabilities.
driver = webdriver.Remote(desired_capabilities=capabilities,

Note: Always use ‘.copy()’ on the DesiredCapabilities object to avoid the side effects of altering the Global class instance.

ANDROID = {'browserName': 'android', 'version': '', 'platform': 'ANDROID'}
CHROME = {'browserName': 'chrome', 'version': '', 'platform': 'ANY'}
EDGE = {'browserName': 'MicrosoftEdge', 'version': '', 'platform': 'WINDOWS'}
FIREFOX = {'browserName': 'firefox', 'marionette': True, 'acceptInsecureCerts': True}
HTMLUNIT = {'browserName': 'htmlunit', 'version': '', 'platform': 'ANY'}
HTMLUNITWITHJS = {'browserName': 'htmlunit', 'version': 'firefox', 'platform': 'ANY', 'javascriptEnabled': True}
INTERNETEXPLORER = {'browserName': 'internet explorer', 'version': '', 'platform': 'WINDOWS'}
IPAD = {'browserName': 'iPad', 'version': '', 'platform': 'MAC'}
IPHONE = {'browserName': 'iPhone', 'version': '', 'platform': 'MAC'}
OPERA = {'browserName': 'opera', 'version': '', 'platform': 'ANY'}
PHANTOMJS = {'browserName': 'phantomjs', 'version': '', 'platform': 'ANY', 'javascriptEnabled': True}
SAFARI = {'browserName': 'safari', 'version': '', 'platform': 'MAC'}
WEBKITGTK = {'browserName': 'MiniBrowser', 'version': '', 'platform': 'ANY'}

This Page