phantomJS runs outside the browser but implements enough of the DOM that you can use it for testing, rendering screenshots, running http: requests, etc.,
http://phantomjs.org/index.html
Have installed locally in: tkzic/phantomjs (binary is in the bin/ folder)
- tutorial: http://net.tutsplus.com/tutorials/javascript-ajax/testing-javascript-with-phantomjs/
- wiki: https://github.com/ariya/phantomjs/wiki/Quick-Start
- examples (look under automation) https://github.com/ariya/phantomjs/wiki/Examples