Class: Selenium::WebDriver::Edge::Bridge Private
- Inherits:
-
Remote::W3CBridge
- Object
- Remote::W3CBridge
- Selenium::WebDriver::Edge::Bridge
- Defined in:
- lib/selenium/webdriver/edge/bridge.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary
Constants inherited from Remote::W3CBridge
Remote::W3CBridge::COMMANDS, Remote::W3CBridge::QUIT_ERRORS
Instance Attribute Summary
Attributes inherited from Remote::W3CBridge
#context, #file_detector, #http
Instance Method Summary collapse
- #browser ⇒ Object private
- #capabilities ⇒ Object private
- #click ⇒ Object private
- #commands(command) ⇒ Object private
- #context_click ⇒ Object private
- #double_click ⇒ Object private
- #driver_extensions ⇒ Object private
- #execute_async_script(script, *args) ⇒ Object private
- #execute_script(script, *args) ⇒ Object private
-
#initialize(opts = {}) ⇒ Bridge
constructor
private
A new instance of Bridge.
- #maximize_window(handle = :current) ⇒ Object private
- #mouse_down ⇒ Object private
- #mouse_move_to(element, x = nil, y = nil) ⇒ Object private
- #mouse_up ⇒ Object private
- #quit ⇒ Object private
- #reposition_window(x, y, handle = :current) ⇒ Object private
- #resize_window(width, height, handle = :current) ⇒ Object private
- #send_keys_to_active_element(key) ⇒ Object private
- #submit_element(element) ⇒ Object private
- #window_handle ⇒ Object private
- #window_position(handle = :current) ⇒ Object private
- #window_size(handle = :current) ⇒ Object private
Methods inherited from Remote::W3CBridge
#accept_alert, #active_element, #add_cookie, #alert=, #alert_text, #clear_element, #clear_local_storage, #clear_session_storage, #click_element, #close, #cookie, #cookies, #create_session, #delete_all_cookies, #delete_cookie, #dismiss_alert, #drag_element, #element_attribute, #element_displayed?, #element_enabled?, #element_location, #element_location_once_scrolled_into_view, #element_property, #element_selected?, #element_size, #element_tag_name, #element_text, #element_value, #element_value_of_css_property, #find_element_by, #find_elements_by, #full_screen_window, #get, #go_back, #go_forward, #implicit_wait_timeout=, #local_storage_item, #local_storage_keys, #local_storage_size, #location, #network_connection, #network_connection=, #options, #page_source, #refresh, #remove_local_storage_item, #remove_session_storage_item, #screen_orientation, #screen_orientation=, #screenshot, #script_timeout=, #send_keys_to_element, #session_id, #session_storage_item, #session_storage_keys, #session_storage_size, #set_location, #status, #switch_to_default_content, #switch_to_frame, #switch_to_parent_frame, #switch_to_window, #timeout, #title, #touch_double_tap, #touch_down, #touch_element_flick, #touch_flick, #touch_long_press, #touch_move, #touch_scroll, #touch_single_tap, #touch_up, #url, #window_handles
Methods included from BridgeHelper
#element_id_from, #parse_cookie_string, #unwrap_script_result
Constructor Details
#initialize(opts = {}) ⇒ Bridge
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Bridge.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 28 def initialize(opts = {}) port = opts.delete(:port) || Service::DEFAULT_PORT service_args = opts.delete(:service_args) || {} unless opts.key?(:url) driver_path = opts.delete(:driver_path) || Edge.driver_path(false) @service = Service.new(driver_path, port, *extract_service_args(service_args)) @service.host = 'localhost' if @service.host == '127.0.0.1' @service.start opts[:url] = @service.uri end opts[:desired_capabilities] ||= Remote::W3CCapabilities.edge super(opts) end |
Instance Method Details
#browser ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
45 46 47 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 45 def browser :edge end |
#capabilities ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
70 71 72 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 70 def capabilities @capabilities ||= Remote::Capabilities.edge end |
#click ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
98 99 100 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 98 def click execute :click, {}, {button: 0} end |
#commands(command) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 56 def commands(command) unsupported = %i[execute_script execute_async_script submit_element double_click mouse_down mouse_up mouse_move_to click send_keys_to_active_element get_window_handles get_current_window_handle get_window_size set_window_size get_window_position set_window_position maximize_window get_alert_text accept_alert dismiss_alert] if unsupported.include? command Remote::Bridge::COMMANDS[command] else super end end |
#context_click ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
102 103 104 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 102 def context_click execute :click, {}, {button: 2} end |
#double_click ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
94 95 96 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 94 def double_click execute :double_click end |
#driver_extensions ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
49 50 51 52 53 54 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 49 def driver_extensions [ DriverExtensions::TakesScreenshot, DriverExtensions::HasInputDevices ] end |
#execute_async_script(script, *args) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
85 86 87 88 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 85 def execute_async_script(script, *args) result = execute :execute_async_script, {}, {script: script, args: args} unwrap_script_result result end |
#execute_script(script, *args) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
80 81 82 83 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 80 def execute_script(script, *args) result = execute :execute_script, {}, {script: script, args: args} unwrap_script_result result end |
#maximize_window(handle = :current) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
157 158 159 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 157 def maximize_window(handle = :current) execute :maximize_window, window_handle: handle end |
#mouse_down ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
106 107 108 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 106 def mouse_down execute :mouse_down end |
#mouse_move_to(element, x = nil, y = nil) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 114 def mouse_move_to(element, x = nil, y = nil) element_id = element['ELEMENT'] if element params = {element: element_id} if x && y params[:xoffset] = x params[:yoffset] = y end execute :mouse_move_to, {}, params end |
#mouse_up ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
110 111 112 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 110 def mouse_up execute :mouse_up end |
#quit ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
74 75 76 77 78 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 74 def quit super ensure @service.stop if @service end |
#reposition_window(x, y, handle = :current) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
152 153 154 155 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 152 def reposition_window(x, y, handle = :current) execute :set_window_position, {window_handle: handle}, {x: x, y: y} end |
#resize_window(width, height, handle = :current) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
140 141 142 143 144 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 140 def resize_window(width, height, handle = :current) execute :set_window_size, {window_handle: handle}, {width: width, height: height} end |
#send_keys_to_active_element(key) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
126 127 128 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 126 def send_keys_to_active_element(key) execute :send_keys_to_active_element, {}, {value: key} end |
#submit_element(element) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
90 91 92 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 90 def submit_element(element) execute :submit_element, id: element['ELEMENT'] end |
#window_handle ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
130 131 132 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 130 def window_handle execute :get_current_window_handle end |
#window_position(handle = :current) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
146 147 148 149 150 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 146 def window_position(handle = :current) data = execute :get_window_position, window_handle: handle Point.new data['x'], data['y'] end |
#window_size(handle = :current) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
134 135 136 137 138 |
# File 'lib/selenium/webdriver/edge/bridge.rb', line 134 def window_size(handle = :current) data = execute :get_window_size, window_handle: handle Dimension.new data['width'], data['height'] end |