0

How I can check browser console if there are any error?

I'm following the watir ubuntu tutorial:

require "selenium-webdriver"
browser = Selenium::WebDriver.for :firefox
browser.get "http://watir.com"
thao786
  • 23
  • 1
  • 4
  • You don't necessarily need to. Errors from commands you run should be automatically forwarded to your ruby code. – max pleaner Oct 23 '16 at 23:12
  • 1
    Possible duplicate of [Check browser console output on Ruby](http://stackoverflow.com/questions/21043406/check-browser-console-output-on-ruby) – max pleaner Oct 23 '16 at 23:13

1 Answers1

0

Easy , add this lines at the end console_logs = browser.driver.manage.logs.get(:browser) puts console_logs

Boikot
  • 304
  • 2
  • 9