In my experience, HtmlUnit is much faster than Firefox, noticeably faster than chrome (the fastest browser with selenium 2.0rc2). HtmlUnit does not require loading external resources, and if you use it without BrowserVersion, javascript is disabled by default:
WebDriver driver = new HtmlUnitDriver();
But if you switch to the browser version, then it will be turned on, but it will work more slowly, since it will load javascript files:
WebDriver driver = new HtmlUnitDriver(BrowserVersion.FIREFOX_3_6);
As they say, javascript does not match real browsers. The homepage of Google and Yahoo is not working properly. Modern browsers are tolerant of certain javascript errors (exploits / hacks), but HtmlUnit is not.
I usually use HtmlUnitDriver on pages / streams that do not require heavy javascript, and I just need to check the elements / data existing on the pages (which are not dynamically loaded).
lukeis
source share