Headless Testing Documentation
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.
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);
desiredCap.SetCapability("platform", "LINUX");
desiredCap.SetCapability("version", "latest");
driver = new RemoteWebDriver(
new Uri("https://hub.testingbot.com/wd/hub/"), desiredCap
);
TestingBot will automatically launch Chrome in headless mode.
We recommend using platform LINUX
for speed, and use the latest version of Chrome.
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.
Mobile Headless Testing
TestingBot uses Appium to run mobile tests.
Appium supports running your iOS and Android tests in headless mode (no screen).
In order to use this with TestingBot, simply specify the headless
option in the desired capabilities.
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("version", "18.0");
caps.setCapability("browserName", "safari");
caps.setCapability("deviceName", "iPhone 16");
caps.setCapability("platformName", "iOS");
caps.setCapability("headless", true);
driver = new RemoteWebDriver(
new Uri("https://hub.testingbot.com/wd/hub/"), desiredCap
);
TestingBot will automatically launch iOS Simulator or Android Emulator in headless mode.