Class: Selenium::WebDriver::Remote::BiDiBridge
- Inherits:
-
Bridge
- Object
- Bridge
- Selenium::WebDriver::Remote::BiDiBridge
show all
- Defined in:
- lib/selenium/webdriver/remote/bidi_bridge.rb
Constant Summary
collapse
- READINESS_STATE =
{
'none' => :none,
'eager' => :interactive,
'normal' => :complete
}.freeze
Constants inherited
from Bridge
Selenium::WebDriver::Remote::Bridge::COMMANDS, Selenium::WebDriver::Remote::Bridge::PORT, Selenium::WebDriver::Remote::Bridge::QUIT_ERRORS
Instance Attribute Summary collapse
Attributes inherited from Bridge
#capabilities, #file_detector, #http
Instance Method Summary
collapse
Methods inherited from Bridge
#accept_alert, #action, #active_element, add_command, #add_cookie, #add_credential, #add_virtual_authenticator, #alert=, #alert_text, #browser, #cancel_fedcm_dialog, #clear_element, #click_element, #click_fedcm_dialog_button, #command_list, #cookie, #cookies, #credentials, #delete_all_cookies, #delete_cookie, #dismiss_alert, #element_aria_label, #element_aria_role, #element_attribute, #element_displayed?, #element_dom_attribute, #element_enabled?, #element_location, #element_location_once_scrolled_into_view, #element_property, #element_rect, #element_screenshot, #element_selected?, #element_size, #element_tag_name, #element_text, #element_value, #element_value_of_css_property, #execute_async_script, #execute_script, #fedcm_account_list, #fedcm_delay, #fedcm_dialog_type, #fedcm_subtitle, #fedcm_title, #find_element_by, #find_elements_by, #full_screen_window, #initialize, #manage, #maximize_window, #minimize_window, #new_window, #page_source, #print_page, #release_actions, #remove_all_credentials, #remove_credential, #remove_virtual_authenticator, #reposition_window, #reset_fedcm_cooldown, #resize_window, #screenshot, #select_fedcm_account, #send_actions, #send_keys_to_element, #session_id, #set_window_rect, #shadow_root, #status, #submit_element, #switch_to_default_content, #switch_to_frame, #switch_to_parent_frame, #switch_to_window, #timeouts, #timeouts=, #title, #url, #user_verified, #window_handle, #window_handles, #window_position, #window_rect, #window_size
Methods included from Atoms
#atom_script
Instance Attribute Details
#bidi ⇒ Object
Returns the value of attribute bidi.
27
28
29
|
# File 'lib/selenium/webdriver/remote/bidi_bridge.rb', line 27
def bidi
@bidi
end
|
#connection ⇒ Object
Returns the value of attribute connection.
27
28
29
|
# File 'lib/selenium/webdriver/remote/bidi_bridge.rb', line 27
def connection
@connection
end
|
Instance Method Details
#close ⇒ Object
76
77
78
|
# File 'lib/selenium/webdriver/remote/bidi_bridge.rb', line 76
def close
execute(:close_window).tap { |handles| bidi.close if handles.empty? }
end
|
#create_session(capabilities) ⇒ Object
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/selenium/webdriver/remote/bidi_bridge.rb', line 35
def create_session(capabilities)
super
begin
@bidi = Selenium::WebDriver::BiDi.new(url: validated_socket_url)
@connection = @bidi.ws
rescue StandardError
quit
raise
end
end
|
#get(url) ⇒ Object
48
49
50
51
|
# File 'lib/selenium/webdriver/remote/bidi_bridge.rb', line 48
def get(url)
browsing_context.navigate(context: window_handle, url: url, wait: readiness_state)
nil
end
|
#go_back ⇒ Object
53
54
55
56
|
# File 'lib/selenium/webdriver/remote/bidi_bridge.rb', line 53
def go_back
browsing_context.traverse_history(context: window_handle, delta: -1)
nil
end
|
#go_forward ⇒ Object
58
59
60
61
|
# File 'lib/selenium/webdriver/remote/bidi_bridge.rb', line 58
def go_forward
browsing_context.traverse_history(context: window_handle, delta: 1)
nil
end
|
#quit ⇒ Object
68
69
70
71
72
73
74
|
# File 'lib/selenium/webdriver/remote/bidi_bridge.rb', line 68
def quit
bidi&.close
rescue *QUIT_ERRORS
nil
ensure
super
end
|
#refresh ⇒ Object
63
64
65
66
|
# File 'lib/selenium/webdriver/remote/bidi_bridge.rb', line 63
def refresh
browsing_context.reload(context: window_handle, wait: readiness_state)
nil
end
|