Class: Selenium::WebDriver::BiDi::Browser Private

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/webdriver/bidi/browser.rb

Overview

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.

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

Defined Under Namespace

Classes: Window

Instance Method Summary collapse

Constructor Details

#initialize(bidi) ⇒ Browser

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 Browser.



36
37
38
# File 'lib/selenium/webdriver/bidi/browser.rb', line 36

def initialize(bidi)
  @bidi = bidi
end

Instance Method Details

#create_user_contextObject

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.



40
41
42
# File 'lib/selenium/webdriver/bidi/browser.rb', line 40

def create_user_context
  @bidi.send_cmd('browser.createUserContext')
end

#remove_user_context(user_context) ⇒ 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.



48
49
50
# 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_contextsObject

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.



44
45
46
# File 'lib/selenium/webdriver/bidi/browser.rb', line 44

def user_contexts
  @bidi.send_cmd('browser.getUserContexts')
end

#windowsObject

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.



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# 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