Path: blob/trunk/rb/lib/selenium/webdriver/remote/bridge/commands.rb
1990 views
# frozen_string_literal: true12# Licensed to the Software Freedom Conservancy (SFC) under one3# or more contributor license agreements. See the NOTICE file4# distributed with this work for additional information5# regarding copyright ownership. The SFC licenses this file6# to you under the Apache License, Version 2.0 (the7# "License"); you may not use this file except in compliance8# with the License. You may obtain a copy of the License at9#10# http://www.apache.org/licenses/LICENSE-2.011#12# Unless required by applicable law or agreed to in writing,13# software distributed under the License is distributed on an14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY15# KIND, either express or implied. See the License for the16# specific language governing permissions and limitations17# under the License.1819module Selenium20module WebDriver21module Remote22#23# https://w3c.github.io/webdriver/#endpoints24# @api private25#2627class Bridge28COMMANDS = {29status: [:get, 'status'],3031#32# session handling33#3435new_session: [:post, 'session'],36delete_session: [:delete, 'session/:session_id'],3738#39# basic driver40#4142get: [:post, 'session/:session_id/url'],43get_current_url: [:get, 'session/:session_id/url'],44back: [:post, 'session/:session_id/back'],45forward: [:post, 'session/:session_id/forward'],46refresh: [:post, 'session/:session_id/refresh'],47get_title: [:get, 'session/:session_id/title'],4849#50# window and Frame handling51#5253get_window_handle: [:get, 'session/:session_id/window'],54new_window: [:post, 'session/:session_id/window/new'],55close_window: [:delete, 'session/:session_id/window'],56switch_to_window: [:post, 'session/:session_id/window'],57get_window_handles: [:get, 'session/:session_id/window/handles'],58fullscreen_window: [:post, 'session/:session_id/window/fullscreen'],59minimize_window: [:post, 'session/:session_id/window/minimize'],60maximize_window: [:post, 'session/:session_id/window/maximize'],61set_window_rect: [:post, 'session/:session_id/window/rect'],62get_window_rect: [:get, 'session/:session_id/window/rect'],63switch_to_frame: [:post, 'session/:session_id/frame'],64switch_to_parent_frame: [:post, 'session/:session_id/frame/parent'],6566#67# element68#6970find_element: [:post, 'session/:session_id/element'],71find_elements: [:post, 'session/:session_id/elements'],72find_child_element: [:post, 'session/:session_id/element/:id/element'],73find_child_elements: [:post, 'session/:session_id/element/:id/elements'],74find_shadow_child_element: [:post, 'session/:session_id/shadow/:id/element'],75find_shadow_child_elements: [:post, 'session/:session_id/shadow/:id/elements'],76get_active_element: [:get, 'session/:session_id/element/active'],77get_element_shadow_root: [:get, 'session/:session_id/element/:id/shadow'],78is_element_selected: [:get, 'session/:session_id/element/:id/selected'],79get_element_attribute: [:get, 'session/:session_id/element/:id/attribute/:name'],80get_element_property: [:get, 'session/:session_id/element/:id/property/:name'],81get_element_css_value: [:get, 'session/:session_id/element/:id/css/:property_name'],82get_element_aria_role: [:get, 'session/:session_id/element/:id/computedrole'],83get_element_aria_label: [:get, 'session/:session_id/element/:id/computedlabel'],84get_element_text: [:get, 'session/:session_id/element/:id/text'],85get_element_tag_name: [:get, 'session/:session_id/element/:id/name'],86get_element_rect: [:get, 'session/:session_id/element/:id/rect'],87is_element_enabled: [:get, 'session/:session_id/element/:id/enabled'],8889#90# document handling91#9293get_page_source: [:get, 'session/:session_id/source'],94execute_script: [:post, 'session/:session_id/execute/sync'],95execute_async_script: [:post, 'session/:session_id/execute/async'],9697#98# cookies99#100101get_all_cookies: [:get, 'session/:session_id/cookie'],102get_cookie: [:get, 'session/:session_id/cookie/:name'],103add_cookie: [:post, 'session/:session_id/cookie'],104delete_cookie: [:delete, 'session/:session_id/cookie/:name'],105delete_all_cookies: [:delete, 'session/:session_id/cookie'],106107#108# timeouts109#110111get_timeouts: [:get, 'session/:session_id/timeouts'],112set_timeout: [:post, 'session/:session_id/timeouts'],113114#115# actions116#117118actions: [:post, 'session/:session_id/actions'],119release_actions: [:delete, 'session/:session_id/actions'],120print_page: [:post, 'session/:session_id/print'],121122#123# Element Operations124#125126element_click: [:post, 'session/:session_id/element/:id/click'],127element_clear: [:post, 'session/:session_id/element/:id/clear'],128element_send_keys: [:post, 'session/:session_id/element/:id/value'],129130#131# alerts132#133134dismiss_alert: [:post, 'session/:session_id/alert/dismiss'],135accept_alert: [:post, 'session/:session_id/alert/accept'],136get_alert_text: [:get, 'session/:session_id/alert/text'],137send_alert_text: [:post, 'session/:session_id/alert/text'],138139#140# screenshot141#142143take_screenshot: [:get, 'session/:session_id/screenshot'],144take_element_screenshot: [:get, 'session/:session_id/element/:id/screenshot'],145146#147# virtual-authenticator148#149150add_virtual_authenticator: [:post, 'session/:session_id/webauthn/authenticator'],151remove_virtual_authenticator: [:delete, 'session/:session_id/webauthn/authenticator/:authenticatorId'],152add_credential: [:post, 'session/:session_id/webauthn/authenticator/:authenticatorId/credential'],153get_credentials: [:get, 'session/:session_id/webauthn/authenticator/:authenticatorId/credentials'],154remove_credential: [:delete,155'session/:session_id/webauthn/authenticator/:authenticatorId/credentials/:credentialId'],156remove_all_credentials: [:delete, 'session/:session_id/webauthn/authenticator/:authenticatorId/credentials'],157set_user_verified: [:post, 'session/:session_id/webauthn/authenticator/:authenticatorId/uv'],158159#160# federated-credential management161#162163get_fedcm_title: [:get, 'session/:session_id/fedcm/gettitle'],164get_fedcm_dialog_type: [:get, 'session/:session_id/fedcm/getdialogtype'],165get_fedcm_account_list: [:get, 'session/:session_id/fedcm/accountlist'],166click_fedcm_dialog_button: [:post, 'session/:session_id/fedcm/clickdialogbutton'],167cancel_fedcm_dialog: [:post, 'session/:session_id/fedcm/canceldialog'],168select_fedcm_account: [:post, 'session/:session_id/fedcm/selectaccount'],169set_fedcm_delay: [:post, 'session/:session_id/fedcm/setdelayenabled'],170reset_fedcm_cooldown: [:post, 'session/:session_id/fedcm/resetcooldown']171}.freeze172end # Bridge173end # Remote174end # WebDriver175end # Selenium176177178