Skip to content

Instantly share code, notes, and snippets.

@jarib
Created September 15, 2012 17:06
Show Gist options
  • Save jarib/3728863 to your computer and use it in GitHub Desktop.
Save jarib/3728863 to your computer and use it in GitHub Desktop.
require 'selenium-webdriver'
require 'pp'
profile = Selenium::WebDriver::Firefox::Profile.new
profile.add_extension 'JSErrorCollector.xpi' # https://github.com/mguillem/JSErrorCollector/raw/master/dist/JSErrorCollector.xpi
driver = Selenium::WebDriver.for :firefox, :profile => profile
# do stuff
errors = driver.execute_script("return window.JSErrorCollector_errors.pump()")
pp errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment