Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.7k points)

The new Google Chrome update causes this message in the browser "You are using an unsupported command-line flag: --ignore-certificate-errors. Stability and security will suffer."

From what I read on selenium bug reports, the temporary solution is to start webdriver with

options.AddArgument("test-type")

I was already passing DesiredCapabilities when creating the driver. How can I pass both ChromeOptions and DesiredCapabilities to the driver?

DesiredCapabilities capabilities = DesiredCapabilities.chrome();

capabilities.setCapability("chrome.switches", Arrays.asList("--incognito"));

ChromeOptions options = new ChromeOptions();

options.addArguments("test-type");

WebDriver driver = new ChromeDriver(capabilities);

1 Answer

0 votes
by (62.9k points)

You can add ChromeOptions to DesiredCapabilities then create the driver with the DesiredCapabilities

Below is the code:

DesiredCapabilities capabilities = DesiredCapabilities.chrome();

ChromeOptions options = new ChromeOptions();

options.addArguments("test-type");

capabilities.setCapability("chrome.binary", "<Path to binary>");

capabilities.setCapability(ChromeOptions.CAPABILITY, options);

webDriver = new ChromeDriver(capabilities);

Browse Categories

...