Class: Selenium::WebDriver::Script
- Inherits:
-
Object
- Object
- Selenium::WebDriver::Script
- Defined in:
- lib/selenium/webdriver/common/script.rb
Instance Method Summary collapse
-
#add_console_message_handler ⇒ int
Id of the handler.
-
#add_javascript_error_handler ⇒ int
Id of the handler.
-
#initialize(bridge) ⇒ Script
constructor
A new instance of Script.
- #remove_console_message_handler(id) ⇒ Object (also: #remove_javascript_error_handler)
Constructor Details
#initialize(bridge) ⇒ Script
Returns a new instance of Script.
23 24 25 |
# File '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_handler ⇒ int
Returns id of the handler.
28 29 30 |
# File 'lib/selenium/webdriver/common/script.rb', line 28 def (&) @log_handler.('console', &) end |
#add_javascript_error_handler ⇒ int
Returns id of the handler.
33 34 35 |
# File 'lib/selenium/webdriver/common/script.rb', line 33 def add_javascript_error_handler(&) @log_handler.('javascript', &) end |
#remove_console_message_handler(id) ⇒ Object Also known as: remove_javascript_error_handler
38 39 40 |
# File 'lib/selenium/webdriver/common/script.rb', line 38 def (id) @log_handler.(id) end |