Reputation: 7215
I am a big advocate for reading the manual. But in this case, despite searching online for some time I cannot find a manual explaining all of the available ChromeOptions
arguments. Somewhere there must be a listing of all of the string arguments and what they mean.
For example, here are some that I found by stumbling through examples:
var options = new ChromeOptions();
options.AddArgument("incognito");
options.AddArguments("test-type");
Can someone please direct me to a listing? I am using C# 4.6, Selenium 2.45.
Upvotes: 104
Views: 189736
Reputation: 352
Latest documentation for Selenium 4 mention ChromOptions arguments in 'Arguments' section -
https://www.selenium.dev/documentation/webdriver/browsers/chrome/#arguments
Upvotes: 1
Reputation: 42528
List of common switches :
/master/chrome/common/chrome_switches.cc
List of headless switches :
/master/headless/app/headless_shell_switches.cc
To search other switches :
https://source.chromium.org/search?q=file:switches.cc&ss=chromium%2Fchromium%2Fsrc
List of preferences:
/master/chrome/common/pref_names.h
Upvotes: 116
Reputation: 1
I believe this should be like this:
ChromeOptions option = new ChromeOptions();
option.AddArgument("test-type");
option.AddArgument("start-maximized");
option.AddArgument("window-size=1920,1080");
option.AddArgument("enable-precise-memory-info");
option.AddArgument("disable-popup-blocking");
option.AddArgument("disable-default-apps");
option.AddArgument("test-type=browser");
Upvotes: 0
Reputation: 2267
This is the one I use: http://peter.sh/experiments/chromium-command-line-switches/
var options = new ChromeOptions();
options.AddArgument("--start-maximized");
options.AddArgument("--ignore-certificate-errors");
options.AddArgument("--disable-popup-blocking");
options.AddArgument("--incognito");
and so forth :)
Upvotes: 111
Reputation: 31
Here is an answer about how to use the ChromeOptions used:
ChromeOptions options = new ChromeOptions();
options.addArguments("test-type");
options.addArguments("start-maximized");
options.addArguments("--window-size=1920,1080");
options.addArguments("--enable-precise-memory-info");
options.addArguments("--disable-popup-blocking");
options.addArguments("--disable-default-apps");
options.addArguments("test-type=browser");
Upvotes: 3