I am working with an automation tool which has to be deployed inside an ubuntu server, my wonder is if is possible to use chrome in a silent way with Selenium Webdriver.
To start Chrome in headless mode, simply call Options.headless()
. Starting in headless mode currently also disables GPU acceleration. This is the code:
var seleniumWebdriver = require('selenium-webdriver');
var chrome = require('selenium-webdriver/chrome');
var options = new chrome.Options().headless();
var driver = new seleniumWebdriver.Builder()
.forBrowser('chrome')
.setChromeOptions(options)
.build();
Note: For security, Chrome disables downloads by default when in headless mode. You may call setDownloadPath
to re-enable downloads.