Class: Selenium::WebDriver::BiDi::Browser
- Inherits:
-
Object
- Object
- Selenium::WebDriver::BiDi::Browser
- Defined in:
- rb/lib/selenium/webdriver/bidi/browser.rb
Defined Under Namespace
Classes: Window
Instance Method Summary collapse
- #create_user_context ⇒ Object
-
#initialize(bidi) ⇒ Browser
constructor
A new instance of Browser.
- #remove_user_context(user_context) ⇒ Object
- #user_contexts ⇒ Object
- #windows ⇒ Object
Constructor Details
#initialize(bidi) ⇒ Browser
Returns a new instance of Browser.
29 30 31 |
# File 'rb/lib/selenium/webdriver/bidi/browser.rb', line 29 def initialize(bidi) @bidi = bidi end |
Instance Method Details
#create_user_context ⇒ Object
33 34 35 |
# File 'rb/lib/selenium/webdriver/bidi/browser.rb', line 33 def create_user_context @bidi.send_cmd('browser.createUserContext') end |
#remove_user_context(user_context) ⇒ Object
41 42 43 |
# File 'rb/lib/selenium/webdriver/bidi/browser.rb', line 41 def remove_user_context(user_context) @bidi.send_cmd('browser.removeUserContext', userContext: user_context) end |
#user_contexts ⇒ Object
37 38 39 |
# File 'rb/lib/selenium/webdriver/bidi/browser.rb', line 37 def user_contexts @bidi.send_cmd('browser.getUserContexts') end |
#windows ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'rb/lib/selenium/webdriver/bidi/browser.rb', line 45 def windows response = @bidi.send_cmd('browser.getClientWindows') response['clientWindows'].map do |win_data| attributes = { handle: win_data['clientWindow'], active: win_data['active'], height: win_data['height'], width: win_data['width'], x: win_data['x'], y: win_data['y'], state: win_data['state'] } Window.new(**attributes) end end |