Set Chrome Options

A ChromeDriver session can further be customized and configured using ChromeOptions. BrowserStack supports the full complement of ChromeOptions.

In this example, ChromeOptions is used to disable Flash in Chrome.

ChromeOptions options = new ChromeOptions();
options.addArguments("--disable-plugins");
caps.setCapability(ChromeOptions.CAPABILITY, options);
// Using chromeOptions to disable Flash in Chrome

var capabilities = {
  "browserName" : "chrome",
  "chromeOptions" : {
    "args" : ["--disable-plugins"]
  }
}
// Using chromeOptions to disable Flash in Chrome

using OpenQA.Selenium.Chrome;

DesiredCapabilities caps;
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.AddArgument("--disable-plugins");
caps = (DesiredCapabilities)chromeOptions.ToCapabilities();
# Using chromeOptions to disable Flash in Chrome

$chromeOptions = array(
 "args" => array("--disable-plugins")
);

$caps = array(
 "chromeOptions" => $chromeOptions
);
# Using chromeOptions to disable Flash in Chrome

capabilities = DesiredCapabilities.CHROME
capabilities["chromeOptions"] = {}
capabilities["chromeOptions"]["args"] = ["--disable-plugins"]
# Using chromeOptions to disable Flash in Chrome

caps = Selenium::WebDriver::Remote::Capabilities.chrome
caps["chromeOptions"] = {}
caps["chromeOptions"]["args"] = ["--disable-plugins"]
# Using chromeOptions to disable Flash in Chrome

$capabilities->{"chromeOptions"} = {
 "args" => ("--disable-plugins")
};

You can read all about ChromeDriver and ChromeOptions here. A complete set of options / command line switches that you can use with ChromeOptions can be found here.

We're sorry to hear that. Please share your feedback so we can do better






Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback