O'Reilly logo

Mastering Selenium WebDriver 3.0 by Mark Collin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Going headless

Going headless seems to be all the rage these days, so let's have a look at how we can add support a headless browser to our burgeoning framework.

It's actually a relatively simple change; first, we are going to use this code to modify our POM to add a <headless> property (we are going to set it to true because you are always going to want to start of running things in headless mode, right?):

<properties>    <project.build.sourceEncoding>UTF-     8</project.build.sourceEncoding>    <project.reporting.outputEncoding>UTF-     8</project.reporting.outputEncoding>    <java.version>1.8</java.version>    <!-- Dependency versions -->    <selenium.version>3.12.0</selenium.version>    <testng.version>6.14.3</testng.version>    <!-- Plugin versions -->    <driver-binary-downloader-maven-plugin.version> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required