Path: blob/trunk/py/selenium/webdriver/remote/command.py
1864 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.161718class Command:19"""Defines constants for the standard WebDriver commands.2021While these constants have no meaning in and of themselves, they are22used to marshal commands through a service that implements WebDriver's23remote wire protocol:2425https://w3c.github.io/webdriver/26"""2728NEW_SESSION: str = "newSession"29DELETE_SESSION: str = "deleteSession"30NEW_WINDOW: str = "newWindow"31CLOSE: str = "close"32QUIT: str = "quit"33GET: str = "get"34GO_BACK: str = "goBack"35GO_FORWARD: str = "goForward"36REFRESH: str = "refresh"37ADD_COOKIE: str = "addCookie"38GET_COOKIE: str = "getCookie"39GET_ALL_COOKIES: str = "getCookies"40DELETE_COOKIE: str = "deleteCookie"41DELETE_ALL_COOKIES: str = "deleteAllCookies"42FIND_ELEMENT: str = "findElement"43FIND_ELEMENTS: str = "findElements"44FIND_CHILD_ELEMENT: str = "findChildElement"45FIND_CHILD_ELEMENTS: str = "findChildElements"46CLEAR_ELEMENT: str = "clearElement"47CLICK_ELEMENT: str = "clickElement"48SEND_KEYS_TO_ELEMENT: str = "sendKeysToElement"49W3C_GET_CURRENT_WINDOW_HANDLE: str = "w3cGetCurrentWindowHandle"50W3C_GET_WINDOW_HANDLES: str = "w3cGetWindowHandles"51SET_WINDOW_RECT: str = "setWindowRect"52GET_WINDOW_RECT: str = "getWindowRect"53SWITCH_TO_WINDOW: str = "switchToWindow"54SWITCH_TO_FRAME: str = "switchToFrame"55SWITCH_TO_PARENT_FRAME: str = "switchToParentFrame"56W3C_GET_ACTIVE_ELEMENT: str = "w3cGetActiveElement"57GET_CURRENT_URL: str = "getCurrentUrl"58GET_PAGE_SOURCE: str = "getPageSource"59GET_TITLE: str = "getTitle"60W3C_EXECUTE_SCRIPT: str = "w3cExecuteScript"61W3C_EXECUTE_SCRIPT_ASYNC: str = "w3cExecuteScriptAsync"62GET_ELEMENT_TEXT: str = "getElementText"63GET_ELEMENT_TAG_NAME: str = "getElementTagName"64IS_ELEMENT_SELECTED: str = "isElementSelected"65IS_ELEMENT_ENABLED: str = "isElementEnabled"66GET_ELEMENT_RECT: str = "getElementRect"67GET_ELEMENT_ATTRIBUTE: str = "getElementAttribute"68GET_ELEMENT_PROPERTY: str = "getElementProperty"69GET_ELEMENT_VALUE_OF_CSS_PROPERTY: str = "getElementValueOfCssProperty"70GET_ELEMENT_ARIA_ROLE: str = "getElementAriaRole"71GET_ELEMENT_ARIA_LABEL: str = "getElementAriaLabel"72SCREENSHOT: str = "screenshot"73ELEMENT_SCREENSHOT: str = "elementScreenshot"74EXECUTE_ASYNC_SCRIPT: str = "executeAsyncScript"75SET_TIMEOUTS: str = "setTimeouts"76GET_TIMEOUTS: str = "getTimeouts"77W3C_MAXIMIZE_WINDOW: str = "w3cMaximizeWindow"78GET_LOG: str = "getLog"79GET_AVAILABLE_LOG_TYPES: str = "getAvailableLogTypes"80FULLSCREEN_WINDOW: str = "fullscreenWindow"81MINIMIZE_WINDOW: str = "minimizeWindow"82PRINT_PAGE: str = "printPage"8384# Alerts85W3C_DISMISS_ALERT: str = "w3cDismissAlert"86W3C_ACCEPT_ALERT: str = "w3cAcceptAlert"87W3C_SET_ALERT_VALUE: str = "w3cSetAlertValue"88W3C_GET_ALERT_TEXT: str = "w3cGetAlertText"8990# Advanced user interactions91W3C_ACTIONS: str = "actions"92W3C_CLEAR_ACTIONS: str = "clearActionState"9394# Screen Orientation95SET_SCREEN_ORIENTATION: str = "setScreenOrientation"96GET_SCREEN_ORIENTATION: str = "getScreenOrientation"9798# Mobile99GET_NETWORK_CONNECTION: str = "getNetworkConnection"100SET_NETWORK_CONNECTION: str = "setNetworkConnection"101CURRENT_CONTEXT_HANDLE: str = "getCurrentContextHandle"102CONTEXT_HANDLES: str = "getContextHandles"103SWITCH_TO_CONTEXT: str = "switchToContext"104105# Web Components106GET_SHADOW_ROOT: str = "getShadowRoot"107FIND_ELEMENT_FROM_SHADOW_ROOT: str = "findElementFromShadowRoot"108FIND_ELEMENTS_FROM_SHADOW_ROOT: str = "findElementsFromShadowRoot"109110# Virtual Authenticator111ADD_VIRTUAL_AUTHENTICATOR: str = "addVirtualAuthenticator"112REMOVE_VIRTUAL_AUTHENTICATOR: str = "removeVirtualAuthenticator"113ADD_CREDENTIAL: str = "addCredential"114GET_CREDENTIALS: str = "getCredentials"115REMOVE_CREDENTIAL: str = "removeCredential"116REMOVE_ALL_CREDENTIALS: str = "removeAllCredentials"117SET_USER_VERIFIED: str = "setUserVerified"118119# Remote File Management120UPLOAD_FILE: str = "uploadFile"121GET_DOWNLOADABLE_FILES: str = "getDownloadableFiles"122DOWNLOAD_FILE: str = "downloadFile"123DELETE_DOWNLOADABLE_FILES: str = "deleteDownloadableFiles"124125# Federated Credential Management (FedCM)126GET_FEDCM_TITLE: str = "getFedcmTitle"127GET_FEDCM_DIALOG_TYPE: str = "getFedcmDialogType"128GET_FEDCM_ACCOUNT_LIST: str = "getFedcmAccountList"129SELECT_FEDCM_ACCOUNT: str = "selectFedcmAccount"130CLICK_FEDCM_DIALOG_BUTTON: str = "clickFedcmDialogButton"131CANCEL_FEDCM_DIALOG: str = "cancelFedcmDialog"132SET_FEDCM_DELAY: str = "setFedcmDelay"133RESET_FEDCM_COOLDOWN: str = "resetFedcmCooldown"134135136