Load page, wait, log any JavaScript errors to file?
Posted
by David
on Stack Overflow
See other posts from Stack Overflow
or by David
Published on 2010-04-08T07:24:46Z
Indexed on
2010/04/08
7:43 UTC
Read the original article
Hit count: 290
JavaScript
I would like to check a large number of HTML files with inline JavaScript for JavaScript errors. What I'm envisioning doing is this: Script a browser to load a given page, wait a few seconds, and finally check the browser logs. I'm unsure though both on how to script a browser to load a given page and on how to access the JavaScript error log. I think the type of errors I'm worried about should show up in any modern browser so I would just go with whatever makes it most convenient. I'd be working either under Mac OS X or Linux.
Anybody already tackle a similar problem? I've thought a bit about hacking something together based on a unit testing framework -- generate a trivial (assertTrue(true)) test for each page and rely on the errors making it fail -- but I'm hoping for something more elegant. Thank you.
© Stack Overflow or respective owner