Skip to content

Instantly share code, notes, and snippets.

@huguogang
Created October 11, 2013 05:12
Show Gist options
  • Save huguogang/6929884 to your computer and use it in GitHub Desktop.
Save huguogang/6929884 to your computer and use it in GitHub Desktop.
Capture Javascript error for Selenium WebDriver
//Client side utilities for Selenium tests of ExtJS web applications
//requires ExtJS and Underscore libraries
//SJTXE - Selenium JavaScript Testing eXtension for ExtJS
(function(root, Ext) {
var root = root || window;
var me = root;
var Ext = Ext;
//private vars
var hasJSError = false;
var onJSError = function(conn, response, options, eOpts) {
hasJSFailure = true;
};
window.onerror = onJSError;
//exposed object
var SJTXE = {
VERSION: '0.0',
hasJSError: function() {return hasJSError}
};
root.SJTXE = SJTXE;
return SJTXE;
})(this, Ext);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment