3
votes

I am using:

  • Ubuntu 14.x 64 bit
  • Chromedriver latest
  • Chrome latest
  • Selenium Java 2.37.1
  • JDK 1.7.0_60

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.

3
I've been seeing the same on Chrome beta, Windows 8.1, c#, and chromedriver 2.9 and 2.10. It doesn't seem to adversely impact the running of the tests. - Richard
Just update the Chrome Driver (>2.21) and it works fine without any extra code. - Chandra Shekhar

3 Answers

3
votes

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);
3
votes

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);
0
votes

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);