Path: blob/trunk/py/selenium/webdriver/common/desired_capabilities.py
4025 views
# Licensed to the Software Freedom Conservancy (SFC) under one1# or more contributor license agreements. See the NOTICE file2# distributed with this work for additional information3# regarding copyright ownership. The SFC licenses this file4# to you under the Apache License, Version 2.0 (the5# "License"); you may not use this file except in compliance6# with the License. You may obtain a copy of the License at7#8# http://www.apache.org/licenses/LICENSE-2.09#10# Unless required by applicable law or agreed to in writing,11# software distributed under the License is distributed on an12# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY13# KIND, either express or implied. See the License for the14# specific language governing permissions and limitations15# under the License.16"""The Desired Capabilities implementation."""171819class DesiredCapabilities:20"""Set of default supported desired capabilities.2122Use this as a starting point for creating a desired capabilities object for23requesting remote webdrivers for connecting to selenium server or selenium grid.2425Usage Example::2627from selenium import webdriver28from selenium.webdriver.firefox.options import Options2930selenium_grid_url = "http://198.0.0.1:4444/wd/hub"3132# Create a new Options object for the desired browser.33options = Options()34options.set_capability("platformName", "windows")35options.browser_version = "142"3637# Instantiate an instance of Remote WebDriver with the new options.38driver = webdriver.Remote(command_executor=selenium_grid_url, options=options)39"""4041FIREFOX = {42"browserName": "firefox",43"acceptInsecureCerts": True,44"moz:debuggerAddress": True,45}4647INTERNETEXPLORER = {48"browserName": "internet explorer",49"platformName": "windows",50}5152EDGE = {53"browserName": "MicrosoftEdge",54}5556CHROME = {57"browserName": "chrome",58}5960SAFARI = {61"browserName": "safari",62"platformName": "mac",63}6465HTMLUNIT = {66"browserName": "htmlunit",67"version": "",68"platform": "ANY",69}7071HTMLUNITWITHJS = {72"browserName": "htmlunit",73"version": "firefox",74"platform": "ANY",75"javascriptEnabled": True,76}7778IPHONE = {79"browserName": "iPhone",80"version": "",81"platform": "mac",82}8384IPAD = {85"browserName": "iPad",86"version": "",87"platform": "mac",88}8990WEBKITGTK = {91"browserName": "MiniBrowser",92}9394WPEWEBKIT = {95"browserName": "MiniBrowser",96}979899