21

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?

Lesmana
  • 25,663
  • 9
  • 82
  • 87
karshitbha
  • 319
  • 1
  • 2
  • 7

10 Answers10

18

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.

Pritam Banerjee
  • 17,953
  • 10
  • 93
  • 108
10

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

Bandham Manikanta
  • 1,858
  • 21
  • 21
  • Whilst this may theoretically answer the question, [it would be preferable](//meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – GhostCat May 18 '17 at 19:08
  • @GhostCat for Chrome 44.0.2403.155, try with http://chromedriver.storage.googleapis.com/index.html?path=2.25/ or lesser vesion driver. hope your issue will get resolved. :) – Bandham Manikanta Nov 07 '17 at 12:47
  • My comment was meant to explain why link only answers are discouraged. That is all I wanted to say. – GhostCat Nov 07 '17 at 14:58
2

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.

Kunle
  • 151
  • 1
  • 2
  • 7
  • i have same issue i change other version of chromedriver and it works for me.and note that chrome driver don't have 64bit version .but good thing is that 32bit work on both 64 and 32 bit window. – Hassan Saeed Dec 07 '17 at 10:46
2

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

Pritam Banerjee
  • 17,953
  • 10
  • 93
  • 108
Eran
  • 527
  • 8
  • 15
0

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

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.

sanjay pujari
  • 459
  • 2
  • 7
  • 23
  • Although your answer is 100% correct, it might also become 100% useless if that link is moved, changed, merged into another one or the main site just disappears... **:-(** Therefore, please [edit] your answer, and copy the relevant steps from the link into your answer, thereby guaranteeing your answer for 100% of the lifetime of this site! **;-)** You can always leave the link in at the bottom of your answer as a source for your material... – Donald Duck Feb 11 '17 at 13:27
0

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.

Syrus
  • 99
  • 6
0

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.

Ankit
  • 1
0

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");
Parameshwar
  • 856
  • 8
  • 16
0

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

  • Hi Jennifer, please post this as a comment on the question, as this is not very specific and detailed. Have a look at https://stackoverflow.com/help/how-to-answer to get more clarity. – Rishabh Kumar Feb 21 '21 at 04:54