Nicholas DiPiazza
Nicholas DiPiazza

Reputation: 10585

Selenium+Chrome on Ubuntu says unsupported command-line flag --ignore-certificate-error

I am using:

When I run a selenium with google chrome, chrome window has a funny yellow warning on the top that says

You are using an unsupported command-line flag --ignore-certificate-error

Anyone ever see that before? Is it a setting in the selenium driver java code?

I do not notice any negative effects.

Upvotes: 3

Views: 2235

Answers (3)

Max
Max

Reputation: 990

Another good option that worked for me - is to disble default flag --ignore-certificate-errors

For Java:

ChromeOptions options = new ChromeOptions();

options.setExperimentalOption("excludeSwitches", Arrays.asList("ignorecertificate-errors"));

WebDriver chromeDriver = new ChromeDriver(options);

Upvotes: 0

kankit
kankit

Reputation: 81

First import the package import org.openqa.selenium.chrome.ChromeOptions; to your test. Add these in the script.

  ChromeOptions options = new ChromeOptions();
  options.addArguments("test-type");
  capabilities.setCapability(ChromeOptions.CAPABILITY, options);

Upvotes: 3

dema_v
dema_v

Reputation: 71

This should remove your funny message. Just configure your driver.

System.setProperty("webdriver.chrome.driver","<<your chrome path>>");
    // To remove message "You are using an unsupported command-line flag: --ignore-certificate-errors.
    // Stability and security will suffer."
    // Add an argument 'test-type'
    DesiredCapabilities capabilities = DesiredCapabilities.chrome();
    ChromeOptions options = new ChromeOptions();
    options.addArguments("test-type");
    capabilities.setCapability("chrome.binary","<<your chrome path>>");


capabilities.setCapability(ChromeOptions.CAPABILITY, options);

    driver = new ChromeDriver(capabilities);

Upvotes: 3

Related Questions