Java Chrome 错误:您正在使用不受支持的命令行标志:--ignore-certifcate-errors。稳定性和安全性将受到影响
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32042187/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Chrome Error: You are using an unsupported command-line flag: --ignore-certifcate-errors. Stability and security will suffer
提问by karshitbha
Browser opens with the below mentioned line-
浏览器打开下面提到的行 -
You are using an unsupported command-line flag: --ignore-certifcate-errors. Stability and security will suffer.
您正在使用不受支持的命令行标志:--ignore-certifcate-errors。稳定性和安全性将受到影响。
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.
当我在 chrome 上运行我的代码时,我遇到了上述错误。
I am using chrome version - 44.0.2403.155 and latest selenium jars.
我正在使用 chrome 版本 - 44.0.2403.155 和最新的硒罐。
Can anybody help me out?
有人可以帮我吗?
回答by Anton Savostytskyi
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);
回答by Pritam Banerjee
You can add this to the shortcut of the chrome browser, in the Target portion:
您可以将此添加到 chrome 浏览器的快捷方式,在 Target 部分:
–test-type
This would disable any warning messages. Not the best solution, but it works.
这将禁用任何警告消息。不是最好的解决方案,但它有效。
回答by Kunle
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.
我最近有这个问题。我发现我在 64 位 Mac 上使用了 32 位 chromedriver。所以我只是用来自https://chromedriver.storage.googleapis.com/index.html?path=2.25/的 64 位 chromedriver 替换了 chromedriver,错误就消失了。
回答by sanjay pujari
Use chromedriver 2.12 version (chromedriver_win32.zip) from the path http://chromedriver.storage.googleapis.com/index.html?path=2.12/
使用来自路径http://chromedriver.storage.googleapis.com/index.html?path=2.12/ 的chromedriver 2.12 版本 (chromedriver_win32.zip)
You wont see this pop up.
你不会看到这个弹出窗口。
回答by Bandham Manikanta
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/
对于 chrome 版本58.0.3029.110
,您应该使用 Chrome.driver 2.28 version
。从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.
注意:如果你想下载其他chromedriver of other version
然后change version number
在上面的url中。
Happy learning
Happy learning
回答by Oliver
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.
如果您的浏览器是最新版本,请尝试使用最新的 chrome 驱动程序。我遇到了同样的问题,但是当将其更改为最新的驱动程序时,它就起作用了。
回答by Ankit
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.
我认为这是由于 chrome 驱动程序与 chrome 浏览器不兼容。1.卸载chrome驱动。2.检查您使用的chrome浏览器版本。3.找到对应的兼容chrome驱动(浏览器版本兼容)并安装。不要忘记在步骤 1 和步骤 3 后重新启动系统。我认为这应该可以解决问题。它对我有用。
回答by Eran
I was able to fix this on Windows by opening the properties of the Chrome shortcut. There I deleted the --ignore-certificate-errors
flag.
我可以通过打开 Chrome 快捷方式的属性在 Windows 上解决这个问题。在那里我删除了--ignore-certificate-errors
标志。