Created
February 26, 2016 13:56
-
-
Save strika/96a07d4cf23af849961f to your computer and use it in GitHub Desktop.
Print browser logs in selenium-webdriver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print_browser_logs | |
logs = page.driver.browser.manage.logs.get(:browser).map { |line| [line.level, line.message] } | |
logs.reject! { |line| ["WARNING", "INFO"].include?(line.first) } | |
puts "========== BROWSER LOGS ==========" | |
logs.each do |line| | |
puts line.join(" - ") | |
end | |
puts "==================================" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment