karshitbha
karshitbha

Reputation: 329

Chrome Error: You are using an unsupported command-line flag: --ignore-certifcate-errors. Stability and security will suffer

Browser opens with the below mentioned line-

You are using an unsupported command-line flag: --ignore-certifcate-errors. Stability and security will suffer.

as well as after few second the browser close and the error is thrown.

I am facing the above error when i run my code on chrome.

I am using chrome version - 44.0.2403.155 and latest selenium jars.

Can anybody help me out?

Upvotes: 22

Views: 81105

Answers (10)

Pritam Banerjee
Pritam Banerjee

Reputation: 18923

You can add this to the shortcut of the chrome browser, in the Target portion:

–-test-type

This would disable any warning messages. Not the best solution, but it works.

Upvotes: 22

Jennifer Ferrell
Jennifer Ferrell

Reputation: 1

Mine had the same error because of chrome remote desktop. I removed it From my programs and I no longer get the error

Upvotes: 0

Parameshwar
Parameshwar

Reputation: 966

Had similar issue so while the following code i added as ChromeOptions helped me resolve this is just as @Pritam Banerjee said

    System.setProperty("webdriver.chrome.driver", "C:\\Program Files\\Java\\chromedriver.exe");
    System.out.println(System.getProperty("webdriver.chrome.driver"));
    ChromeOptions chromeOptions = new ChromeOptions();
    chromeOptions.addArguments("no-sandbox");
    chromeOptions.addArguments("--test-type");// this is the one that helped
    chromeOptions.addArguments("disable-extensions");
    chromeOptions.addArguments("--start-maximized");
    WebDriver driver = new ChromeDriver(chromeOptions);
    driver.get("https://www.google.com");
    System.out.println("Google is selected");

Upvotes: 0

Bandham Manikanta
Bandham Manikanta

Reputation: 1985

For a chrome version of 58.0.3029.110, You should use Chrome.driver of 2.28 version. Download driver from http://chromedriver.storage.googleapis.com/index.html?path=2.28/

Note: If you want to download other chromedriver of other version then change version number in the above url.

Happy learning

Upvotes: 10

Eran
Eran

Reputation: 555

I was able to fix this on Windows by opening the properties of the Chrome shortcut. There I deleted the --ignore-certificate-errors flag.

Upvotes: 2

Ankit
Ankit

Reputation: 1

I think this is due to chrome driver incompatibility with chrome browser. 1.Uninstall chrome driver. 2.Check the chrome browser version you are using. 3.Find a corresponding compatible chrome driver( browser version compatible) and install it. Do not forget to restart the system after step 1 and step 3. I think this should fix the issue. It worked for me.

Upvotes: 0

Syrus
Syrus

Reputation: 99

If your browser the latest version try with the latest chrome driver. I got the same issue but when changed it to the latest driver and it worked.

Upvotes: 0

sanjay pujari
sanjay pujari

Reputation: 489

Use chromedriver 2.12 version (chromedriver_win32.zip) from the path http://chromedriver.storage.googleapis.com/index.html?path=2.12/

You wont see this pop up.

Upvotes: 0

Kunle
Kunle

Reputation: 151

I had this issue recently. I found out I was using a 32-bit chromedriver for a 64-bit Mac. So I simply replaced the chromedriver with a 64-bit chromedriver from https://chromedriver.storage.googleapis.com/index.html?path=2.25/ and the error was gone.

Upvotes: 2

Anton Savostytskyi
Anton Savostytskyi

Reputation: 178

Try this code when you create driver. I hope it will help:

DesiredCapabilities capabilities = DesiredCapabilities.chrome();
ChromeOptions options = new ChromeOptions();
setDefaultCapabilities(capabilities);
capabilities.setCapability("chrome.switches", Arrays.asList("--ignore-certificate-errors"));
options.addArguments(Arrays.asList("allow-running-insecure-content", "ignore-certificate-errors"));
capabilities.setCapability(ChromeOptions.CAPABILITY, options);

Upvotes: 0

Related Questions