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.
Using the ChromeOptions class You can create an instance of ChromeOptions, which has convenient methods for setting ChromeDriver-specific capabilities. You can then pass the ChromeOptions object into the ChromeDriver constructor: ChromeOptions options = new ChromeOptions(); options.
To declare Desired Capabilities in Selenium automation testing using Grid, we can use the setCapability method from the DesiredCapabilities class to set the different types of capabilities of the browser (Ex. Chrome, IE, Firefox, Edge) platform name (Ex. Windows, macOS, etc.).
The WebDriver language APIs provides ways to pass capabilities to ChromeDriver. The exact mechanism differs by the language, but most languages use one or both of the following mechanisms: Use the ChromeOptions class. This is supported by Java, Python, etc.
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.cc
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 :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With