Skip to content

Instantly share code, notes, and snippets.

@halcyon
Forked from jarib/js_error_collector.rb
Created September 13, 2013 12:19
Show Gist options
  • Save halcyon/6549941 to your computer and use it in GitHub Desktop.
Save halcyon/6549941 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