Class: Selenium::WebDriver::BiDi::Session Private

Inherits:
Object
  • Object
show all
Defined in:
rb/lib/selenium/webdriver/bidi/session.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.

Implements the Session Module of the WebDriver-BiDi specification

Defined Under Namespace

Classes: Status

Instance Method Summary collapse

Constructor Details

#initialize(bidi) ⇒ Session

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



30
31
32
# File 'rb/lib/selenium/webdriver/bidi/session.rb', line 30

def initialize(bidi)
  @bidi = bidi
end

Instance Method Details

#statusObject

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.



34
35
36
37
# File 'rb/lib/selenium/webdriver/bidi/session.rb', line 34

def status
  status = @bidi.send_cmd('session.status')
  Status.new(**status)
end

#subscribe(events, browsing_contexts = 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.



39
40
41
42
43
44
# File 'rb/lib/selenium/webdriver/bidi/session.rb', line 39

def subscribe(events, browsing_contexts = nil)
  opts = {events: Array(events)}
  opts[:browsing_contexts] = Array(browsing_contexts) if browsing_contexts

  @bidi.send_cmd('session.subscribe', **opts)
end

#unsubscribe(events, browsing_contexts = 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.



46
47
48
49
50
51
# File 'rb/lib/selenium/webdriver/bidi/session.rb', line 46

def unsubscribe(events, browsing_contexts = nil)
  opts = {events: Array(events)}
  opts[:browsing_contexts] = Array(browsing_contexts) if browsing_contexts

  @bidi.send_cmd('session.unsubscribe', **opts)
end