Reputation: 31
We are running JS functional / integration tests (in a browser) via CI. They include synchronous and asynchronous tests using the YUI Test framework. Tests run, results are collected and posted to a custom result file writer.
One problem that we have been facing is that tests are timing out from time to time presumably because of a JS exception.
I'm curious if there is a way to listen in some way to anything that goes to the browser's console whether console.debug() or exception info. Our target browsers for this project are Chrome and Safari.
Any thoughts?
Upvotes: 3
Views: 1656
Reputation: 76
For chrome you can use the tool name sawbuck this is tool is similar to dbgview it lets you see all the console logs.
see https://code.google.com/p/sawbuck/ for more details
Upvotes: 1
Reputation: 39808
Sadly, I don't think there is a way. WebKit's Console object has become almost FireBug's identical, prototype-wise, so you can have a look at FireBug's Console API. Of course, you can always mock-up the developer's tool and look at the Console's prototype (simply type console and look at its __proto__
method.
If you just want to catch errors sent to the console, why not use a try...catch
statement?
Upvotes: 0