Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Selenium Web Driver Set Chrome Options
//import the selenium web driver
var webdriver = require('selenium-webdriver');
var chromeCapabilities =;
//setting chrome options to start the browser fully maximized
var chromeOptions = {
'args': ['--test-type', '--start-maximized']
chromeCapabilities.set('chromeOptions', chromeOptions);
var driver = new webdriver.Builder().withCapabilities(chromeCapabilities).build();
Copy link

Thanks @qquach

Copy link

Copy link

You rock!

Copy link

For newer versions of Node with ES modules enabled (14+)

import chrome from 'selenium-webdriver/chrome.js';

let opts = new chrome.Options();
opts.excludeSwitches('enable-automation'); // disable 'Chrome is being controlled by automation' banner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment