Created
October 11, 2013 05:12
-
-
Save huguogang/6929884 to your computer and use it in GitHub Desktop.
Capture Javascript error for Selenium WebDriver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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