Headless Testing

Headless testing significantly minimizes the time it takes to run a test. Because the browser is started in headless mode, it is not necessary to load the entire UI (User Interface).
This means the time it takes for the browser to start up is significantly faster.


Since the browser starts faster, your tests in headless mode will be finished faster.
You can still take screenshots during headless mode. Video recording of the test however is not possible: we cannot record a video of the UI since there is no UI.

Chrome Headless Testing

To run a headless test on Chrome, please see the example below.
The important part is the 'headless': true configuration in the desired_capabilities.


DesiredCapabilities desiredCap = DesiredCapabilities.Chrome();
desiredCap.SetCapability("headless", true);

driver = new RemoteWebDriver(
  new Uri("https://hub.testingbot.com/wd/hub/"), desiredCap
);

TestingBot will automatically launch Chrome in headless mode.

Firefox Headless Testing

To run a headless test on Firefox, please see the example below.
The important part is the 'headless': true configuration in the desired_capabilities.


DesiredCapabilities desiredCap = DesiredCapabilities.Firefox();
desiredCap.SetCapability("headless", true);

driver = new RemoteWebDriver(
  new Uri("https://hub.testingbot.com/wd/hub/"), desiredCap
);

TestingBot will automatically launch Firefox in headless mode.