Member-only story
Headless Browser Testing Clarified
Headless Browser Testing is mostly unnecessary.

This article is one of the “IT Terminology Clarified” series.
Headless Browser Testing is a way of running browser tests without the UI (head, a term from Unix). Let’s have a look at a Selenium test execution in headless mode as well as a normal mode for comparison.
Demo: Headless vs Normal
Firstly, normal selenium test execution with browser UI.

Then the same test is run in headless mode.

As you can see, there is no Chrome browser shown during the second test execution and the test still passed. This is headless testing.
History of Headless Browser Testing
Between 2010–2015, Headless browser testing with Phantom JS was hyped highly by test architects/engineers. I tried and was puzzled on how it could possibly work. I wrote down my suggestion to avoid headless testing with Phantom JS in my book “Selenium WebDriver Recipes in Ruby”.
In 2017, Phantom JS was deprecated. According to Vitaly Slobodin, the main maintainer: “(Headless) Chrome is faster and more stable than PhantomJS. And it doesn’t eat memory like crazy. I don’t see any future in developing PhantomJS.” It turned out that those ‘we did headless testing with Phantom JS’ were just lies. (if the test automation framework is not reliable, ….)
Chrome v59 (released in June 2017) introduced its headless mode. Here I mean real headless.
How to start Chrome in headless mode?
old way:
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('headless')
driver = Selenium::WebDriver.for :chrome, :options => options
New way:
options = Selenium::WebDriver::Chrome::Options.new…