Skip to content

Instantly share code, notes, and snippets.

@ascv
Last active December 14, 2015 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ascv/5122536 to your computer and use it in GitHub Desktop.
Save ascv/5122536 to your computer and use it in GitHub Desktop.
How to catch javascript errors in the Firefox WebDriver using the JSErrorCollector extension. Get JSErrorCollector.xpi from https://github.com/mguillem/JSErrorCollector.
from selenium import webdriver
profile = webdriver.FirefoxProfile()
profile.add_extension('JSErrorCollector.xpi')
ff=webdriver.Firefox(profile)
ff.get('http://www.somepage.com')
ff.execute_script('return window.JSErrorCollector_errors.pump()')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment