I'm using a technique I found [here][1], to capture javascript errors for testing purposes. It's a technique that is [frequently][2] [recommended][3] on [Stack Overflow][4] for those who need to catch JavaScript errors on the fly, and it at least got me something I could work with. The implementation is as follows: My web dev put the following into a script called "error.js": window.jsErrors = []; window.onerror = function(errorMessage) { window.jsErrors[window.jsErrors.length] = errorMessage; } Which is getting loaded into the <head> of every page, via an include. I have a method set up to return the collected errors to my tests, as an array, like so: public static Array JsErrorList(this IWebDriver driver) { try { return ((IJavaScriptExecutor)driver) .ExecuteScript("return window.jsErrors.toString()") .ToString().Split(",".ToCharArray()); } catch { return new string[,] {}; } } When running my tests cross-browser, I've noticed something very odd. On Chrome(18) and Firefox(10) the only thing that ever gets reported back, is the string "Script error." IE(8) is the only browser that reports the actual JavaScript error text. I wonder if the problem might lie in the way I'm invoking window.jsErorrs, but I'm not sure exactly. Could this be a problem with differences between the browser drivers? What has everyone else's experience been? If anyone has any suggestions, I'd surely be grateful. My Environment: - Windows 7 (64bit) - .Net Framework 4.0.30319 (C#) - Visual Studio 2010 (10.0.40219.1) - Nunit 2.6.12051 - C# WebDriver [2.20.0][5] - InternetExplorerDriver [2.2.0.1][6] - ChromeDriver [19][7] - Firefox 10 [1]: http://mguillem.wordpress.com/2011/10/11/webdriver-capture-js-errors-while-running-tests/ [2]: https://stackoverflow.com/questions/8317705/c-sharp-selenium-webdriver-javasript-errors-logging [3]: https://stackoverflow.com/questions/5865875/is-there-any-way-to-automate-javascript-errors-thrown-in-firefox-ie [4]: https://stackoverflow.com/questions/4189312/capturing-javascript-error-in-selenium [5]: http://code.google.com/p/selenium/downloads/detail?name=selenium-dotnet-2.20.0.zip&can=2&q= [6]: http://code.google.com/p/selenium/downloads/list [7]: http://code.google.com/p/chromedriver/downloads/list