This guide will show you how you can run your current Selenium scripts against headless browsers on CrossBrowserTesting which can help accelerate your QA process by up to 300%! By focusing early testing on headless Chrome and Firefox, you can find issues sooner in the testing cycle enabling your developers to react quickly and shorten the overall testing time. As an additional benefit, Automation plans with 5 or more parallels give you twice the parallel headless capacity as a standard selenium test.
How do I get started?
Running against our Headless Containers is easy with CrossBrowserTesting. In your current selenium scripts, you’ll likely have a spot where you point the tests at our Selenium Hub, like this:
When running tests against containers, we want to change that slightly. The new one should look like this:
In addition to that, you’ll also want to specify a new platform capability within your WebDriver configuration. An example of capabilities can be found below:
caps.setCapability("browserName", "Chrome"); // Firefox also available caps.setCapability("platform", "Headless");
And that’s all you really need! We also support a number of resolutions so you can resize the container for visual changes. Those resolutions can be found in our capabilities configurator.
How many tests can I run in parallel?
If your plan allows for 5 or more automated parallel tests, you will be able to run twice as many parallel tests with our Headless Containers! For example, a 10-parallel automated account will be able to run 20 headless automated tests in parallel. These do not count toward your normal automated parallel slots, so that account will be able to run 10 parallel tests on our test Windows, Mac, or real mobile devices, as well as 20 headless automated tests at the same time.
How many tests can I queue?
You can queue up to the amount of headless parallel slots you have. So if you have 10 headless parallel tests allowed on your plan, you can also queue up to 10 tests.