Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.