I am using maven here.Here is my Selenium code:
DesiredCapabilities capb = DesiredCapabilities.chrome(); capb.setCapability("chrome.binary","/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"); ChromeOptions options = new ChromeOptions(); options.addArguments("--headless","--disable-gpu", "--no-sandbox","--remote-debugging-port=9222"); capb.setCapability(ChromeOptions.CAPABILITY, options); System.setProperty("webdriver.chrome.driver","/Users/nitinkumar/TEST/chromedriver"); try{ ChromeDriver driver = new ChromeDriver(capb); driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); driver.get("https://qa.cmnetwork.co"); driver.quit(); } catch(Exception e) { e.printStackTrace(); } when I run "mvn test" it starts the chrome in GUI mode. but It should open in Headless mode. I have chrome vesrion 59.0, OS X yosemite(10.10.5), chromedriver 2.30 and Selenium 3.4.0.
Headless mode is available on Mac and Linux in Chrome 59. Windows support is coming in Chrome 60. To check what version of Chrome you have, open chrome://version.driver = new ChromeDriver(options);