class Selenium::WebDriver::BiDi::Browser

BiDi Implementation of the Browser Module Continue to use functionality from existing ‘driver.manager.window` method

@api private

Constants

Window

Public Class Methods

new(bidi) click to toggle source
# File lib/selenium/webdriver/bidi/browser.rb, line 36
def initialize(bidi)
  @bidi = bidi
end

Public Instance Methods

create_user_context() click to toggle source
# File lib/selenium/webdriver/bidi/browser.rb, line 40
def create_user_context
  @bidi.send_cmd('browser.createUserContext')
end
remove_user_context(user_context) click to toggle source
# File lib/selenium/webdriver/bidi/browser.rb, line 48
def remove_user_context(user_context)
  @bidi.send_cmd('browser.removeUserContext', userContext: user_context)
end
user_contexts() click to toggle source
# File lib/selenium/webdriver/bidi/browser.rb, line 44
def user_contexts
  @bidi.send_cmd('browser.getUserContexts')
end
windows() click to toggle source
# File lib/selenium/webdriver/bidi/browser.rb, line 52
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