123456789_123456789_123456789_123456789_123456789_

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

Relationships & Source Files
Namespace Children
Classes:
Inherits: Object
Defined in: rb/lib/selenium/webdriver/bidi/session.rb

Class Method Summary

Instance Method Summary

Constructor Details

.new(bidi) ⇒ Session

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/bidi/session.rb', line 26

def initialize(bidi)
  @bidi = bidi
end

Instance Method Details

#status

[ GitHub ]

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

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

#subscribe(events, browsing_contexts = nil)

[ GitHub ]

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

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)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/bidi/session.rb', line 42

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