Headless Browser Testing – Selenium WebDriver

Headless browser testing is simply testing a web pages functionality, without a GUI present. There are various different browsers we could use for this, including:

  • Chrome
  • Firefox
  • PhantomJS
  • HtmlUnit

PhantomJS is the only driver that must be downloaded separately, the other three, come bundled in with their corresponding driver servers, or with Selenium as a whole.

Chrome Headless Browser

To test against Chromes built-in headless browser, we can use:

Firefox Headless Browser

To test against Firefox’x built-in headless browser, we can use:

PhantomJS Headless Browser

To test against PhantomJS headless browser, does require the PhantomJS driver, which can be downloaded from: http://phantomjs.org/

You can then use:

HtmlUnit Headless Browser

To test against Selenium’s built-in headless browser, we can use:

For more information regarding Selenium WebDriver, please see our: