123456789_123456789_123456789_123456789_123456789_

Class: Selenium::WebDriver::Script

Relationships & Source Files
Inherits: Object
Defined in: rb/lib/selenium/webdriver/common/script.rb

Class Method Summary

Instance Method Summary

Constructor Details

.new(bridge) ⇒ Script

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/script.rb', line 23

def initialize(bridge)
  @log_handler = BiDi::LogHandler.new(bridge.bidi)
end

Instance Method Details

#add_console_message_handlerint

Returns:

  • (int)

    id of the handler

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/script.rb', line 28

def add_console_message_handler(&)
  @log_handler.add_message_handler('console', &)
end

#add_javascript_error_handlerint

Returns:

  • (int)

    id of the handler

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/script.rb', line 33

def add_javascript_error_handler(&)
  @log_handler.add_message_handler('javascript', &)
end

#remove_console_message_handler(id) Also known as: #remove_javascript_error_handler

Parameters:

  • id (int)

    of the handler previously added

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/script.rb', line 38

def remove_console_message_handler(id)
  @log_handler.remove_message_handler(id)
end

#remove_javascript_error_handler(id)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/script.rb', line 42

alias remove_javascript_error_handler remove_console_message_handler