Skip to content

Instantly share code, notes, and snippets.

@asiellb
Forked from anandsunderraman/setChromeOptions.js
Created November 16, 2022 02:44
Show Gist options
  • Save asiellb/f339a41a1f0a1936a7a7e0413cbc9370 to your computer and use it in GitHub Desktop.
Save asiellb/f339a41a1f0a1936a7a7e0413cbc9370 to your computer and use it in GitHub Desktop.
Selenium Web Driver Set Chrome Options
//import the selenium web driver
var webdriver = require('selenium-webdriver');
var chromeCapabilities = webdriver.Capabilities.chrome();
//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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment