Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
SeleniumHQ
GitHub Repository: SeleniumHQ/Selenium
Path: blob/trunk/py/selenium/webdriver/remote/command.py
1864 views
1
# Licensed to the Software Freedom Conservancy (SFC) under one
2
# or more contributor license agreements. See the NOTICE file
3
# distributed with this work for additional information
4
# regarding copyright ownership. The SFC licenses this file
5
# to you under the Apache License, Version 2.0 (the
6
# "License"); you may not use this file except in compliance
7
# with the License. You may obtain a copy of the License at
8
#
9
# http://www.apache.org/licenses/LICENSE-2.0
10
#
11
# Unless required by applicable law or agreed to in writing,
12
# software distributed under the License is distributed on an
13
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
# KIND, either express or implied. See the License for the
15
# specific language governing permissions and limitations
16
# under the License.
17
18
19
class Command:
20
"""Defines constants for the standard WebDriver commands.
21
22
While these constants have no meaning in and of themselves, they are
23
used to marshal commands through a service that implements WebDriver's
24
remote wire protocol:
25
26
https://w3c.github.io/webdriver/
27
"""
28
29
NEW_SESSION: str = "newSession"
30
DELETE_SESSION: str = "deleteSession"
31
NEW_WINDOW: str = "newWindow"
32
CLOSE: str = "close"
33
QUIT: str = "quit"
34
GET: str = "get"
35
GO_BACK: str = "goBack"
36
GO_FORWARD: str = "goForward"
37
REFRESH: str = "refresh"
38
ADD_COOKIE: str = "addCookie"
39
GET_COOKIE: str = "getCookie"
40
GET_ALL_COOKIES: str = "getCookies"
41
DELETE_COOKIE: str = "deleteCookie"
42
DELETE_ALL_COOKIES: str = "deleteAllCookies"
43
FIND_ELEMENT: str = "findElement"
44
FIND_ELEMENTS: str = "findElements"
45
FIND_CHILD_ELEMENT: str = "findChildElement"
46
FIND_CHILD_ELEMENTS: str = "findChildElements"
47
CLEAR_ELEMENT: str = "clearElement"
48
CLICK_ELEMENT: str = "clickElement"
49
SEND_KEYS_TO_ELEMENT: str = "sendKeysToElement"
50
W3C_GET_CURRENT_WINDOW_HANDLE: str = "w3cGetCurrentWindowHandle"
51
W3C_GET_WINDOW_HANDLES: str = "w3cGetWindowHandles"
52
SET_WINDOW_RECT: str = "setWindowRect"
53
GET_WINDOW_RECT: str = "getWindowRect"
54
SWITCH_TO_WINDOW: str = "switchToWindow"
55
SWITCH_TO_FRAME: str = "switchToFrame"
56
SWITCH_TO_PARENT_FRAME: str = "switchToParentFrame"
57
W3C_GET_ACTIVE_ELEMENT: str = "w3cGetActiveElement"
58
GET_CURRENT_URL: str = "getCurrentUrl"
59
GET_PAGE_SOURCE: str = "getPageSource"
60
GET_TITLE: str = "getTitle"
61
W3C_EXECUTE_SCRIPT: str = "w3cExecuteScript"
62
W3C_EXECUTE_SCRIPT_ASYNC: str = "w3cExecuteScriptAsync"
63
GET_ELEMENT_TEXT: str = "getElementText"
64
GET_ELEMENT_TAG_NAME: str = "getElementTagName"
65
IS_ELEMENT_SELECTED: str = "isElementSelected"
66
IS_ELEMENT_ENABLED: str = "isElementEnabled"
67
GET_ELEMENT_RECT: str = "getElementRect"
68
GET_ELEMENT_ATTRIBUTE: str = "getElementAttribute"
69
GET_ELEMENT_PROPERTY: str = "getElementProperty"
70
GET_ELEMENT_VALUE_OF_CSS_PROPERTY: str = "getElementValueOfCssProperty"
71
GET_ELEMENT_ARIA_ROLE: str = "getElementAriaRole"
72
GET_ELEMENT_ARIA_LABEL: str = "getElementAriaLabel"
73
SCREENSHOT: str = "screenshot"
74
ELEMENT_SCREENSHOT: str = "elementScreenshot"
75
EXECUTE_ASYNC_SCRIPT: str = "executeAsyncScript"
76
SET_TIMEOUTS: str = "setTimeouts"
77
GET_TIMEOUTS: str = "getTimeouts"
78
W3C_MAXIMIZE_WINDOW: str = "w3cMaximizeWindow"
79
GET_LOG: str = "getLog"
80
GET_AVAILABLE_LOG_TYPES: str = "getAvailableLogTypes"
81
FULLSCREEN_WINDOW: str = "fullscreenWindow"
82
MINIMIZE_WINDOW: str = "minimizeWindow"
83
PRINT_PAGE: str = "printPage"
84
85
# Alerts
86
W3C_DISMISS_ALERT: str = "w3cDismissAlert"
87
W3C_ACCEPT_ALERT: str = "w3cAcceptAlert"
88
W3C_SET_ALERT_VALUE: str = "w3cSetAlertValue"
89
W3C_GET_ALERT_TEXT: str = "w3cGetAlertText"
90
91
# Advanced user interactions
92
W3C_ACTIONS: str = "actions"
93
W3C_CLEAR_ACTIONS: str = "clearActionState"
94
95
# Screen Orientation
96
SET_SCREEN_ORIENTATION: str = "setScreenOrientation"
97
GET_SCREEN_ORIENTATION: str = "getScreenOrientation"
98
99
# Mobile
100
GET_NETWORK_CONNECTION: str = "getNetworkConnection"
101
SET_NETWORK_CONNECTION: str = "setNetworkConnection"
102
CURRENT_CONTEXT_HANDLE: str = "getCurrentContextHandle"
103
CONTEXT_HANDLES: str = "getContextHandles"
104
SWITCH_TO_CONTEXT: str = "switchToContext"
105
106
# Web Components
107
GET_SHADOW_ROOT: str = "getShadowRoot"
108
FIND_ELEMENT_FROM_SHADOW_ROOT: str = "findElementFromShadowRoot"
109
FIND_ELEMENTS_FROM_SHADOW_ROOT: str = "findElementsFromShadowRoot"
110
111
# Virtual Authenticator
112
ADD_VIRTUAL_AUTHENTICATOR: str = "addVirtualAuthenticator"
113
REMOVE_VIRTUAL_AUTHENTICATOR: str = "removeVirtualAuthenticator"
114
ADD_CREDENTIAL: str = "addCredential"
115
GET_CREDENTIALS: str = "getCredentials"
116
REMOVE_CREDENTIAL: str = "removeCredential"
117
REMOVE_ALL_CREDENTIALS: str = "removeAllCredentials"
118
SET_USER_VERIFIED: str = "setUserVerified"
119
120
# Remote File Management
121
UPLOAD_FILE: str = "uploadFile"
122
GET_DOWNLOADABLE_FILES: str = "getDownloadableFiles"
123
DOWNLOAD_FILE: str = "downloadFile"
124
DELETE_DOWNLOADABLE_FILES: str = "deleteDownloadableFiles"
125
126
# Federated Credential Management (FedCM)
127
GET_FEDCM_TITLE: str = "getFedcmTitle"
128
GET_FEDCM_DIALOG_TYPE: str = "getFedcmDialogType"
129
GET_FEDCM_ACCOUNT_LIST: str = "getFedcmAccountList"
130
SELECT_FEDCM_ACCOUNT: str = "selectFedcmAccount"
131
CLICK_FEDCM_DIALOG_BUTTON: str = "clickFedcmDialogButton"
132
CANCEL_FEDCM_DIALOG: str = "cancelFedcmDialog"
133
SET_FEDCM_DELAY: str = "setFedcmDelay"
134
RESET_FEDCM_COOLDOWN: str = "resetFedcmCooldown"
135
136