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