title: Selenium vs HtmlUnit?
body: <p>I am trying to understand testing framework better and been looking into Selenium. I've used <a href="http://htmlunit.sourceforge.net/" rel="noreferrer">HTMLUnit</a> before, mainly when I needed to scrape some information off website or the likes.</p>
  
  <p>In the context of writing test automation, what's the advantage / disadvantages of Selenium vs HTMLUnit? Looks to me Selenium is more complicated to set up than HTMLUnit, although at the same time there's a HTMLUnitDriver for Selenium which I think behave the exact same way as in HTMLUnit itself? </p>
  
  <p>Selenium obviously provides more robust framework, it has the Selenium RC for pararel testing, it also has different browser drivers that can be used - although when you used the browser drivers, the test will actually open/close a browser application rather than headless.</p>
  
  <p>May be I am not understanding Selenium correctly. Some directions and pointers would be great!</p>
  
  <p>On another note - a separate question - I am also looking at doing automated testing on mobile browser, I see that Selenium has an <a href="http://code.google.com/p/selenium/wiki/IPhoneDriver" rel="noreferrer">IPhoneDriver</a> for it, but then this is not a headless testing either as it requires actual iOS simulator. </p>
  
  <p>Is there anyway to do headless testing on mobile sites? Would changing user-agent be sufficient? I've seen a couple posts around changing user-agent that seem to have their own challenges, eg. <a href="https://stackoverflow.com/questions/4565250/set-user-agent-in-selenium-rc">Set user-agent in Selenium RC</a> </p>
  
  <p>Thanks a lot!</p>