【问题标题】:Chrome error "you are using an unsupported command-line flag: --ignore-certificate-errors."Chrome 错误“您正在使用不受支持的命令行标志:--ignore-certificate-errors。”
【发布时间】:2014-09-24 12:54:13
【问题描述】:

我正在使用 Coded UI 在 Chrome 上测试我的 Web 应用程序。我正在使用 Coded UI 提供的跨浏览器支持。

我正在使用以下版本 -

Visual Studio:2013

硒点网绑定:2.43

当我在 Chrome 中使用 BrowserWindow.CurrentBrowser = "Chrome" 启动 Web 应用程序时,Chrome 浏览器会打开并弹出窗口 - “您正在使用不受支持的命令行标志:--ignore-certificate-errors. ... ”。

我在网上找到了一些建议,但这些建议似乎是针对那些直接使用 Selenium 的人。

但是,它们似乎不适用于这里,因为我使用的是编码 UI。

谁能告诉我如何解决这个问题?

问候, kvk1985

【问题讨论】:

  • 归根结底,解决这个问题的方法是在 --ignore-certificate-errors 之外传递参数 --test-type

标签: google-chrome selenium


【解决方案1】:

请使用下面的代码,它对我有用...

  IWebDriver driver;
        ChromeOptions options = new ChromeOptions();
        options.AddArguments("--disable-extensions");
        options.AddArgument("test-type");
        options.AddArgument("--ignore-certificate-errors");
        options.AddArgument("no-sandbox");
        driver = new ChromeDriver(options);
        driver.Manage().Window.Maximize();
        driver.Navigate().GoToUrl("https://ahn-qa2.aon.com/home.aspx");

【讨论】:

  • 请解释一下你的答案。
【解决方案2】:

我在 Visual Studio 2013 Premium Update 4 中遇到了同样的问题。 最新版本的 chromedriver.exe (2.12) 为我们解决了这个问题。

  1. http://chromedriver.storage.googleapis.com/index.html的2.12目录下载适用的zip
  2. 右键单击下载的 zip 文件。
  3. 选择“属性”。
  4. 在“常规”选项卡下,单击“取消阻止”按钮。
  5. 现在解压缩这两个文件并将内容复制到以下路径。复制现有版本的 chromedriver.exe

“%ProgramFiles%\Common Files\microsoft shared\VSTT\Cross Browser Selenium Components”(适用于 32 位机器)

“%ProgramFiles(x86)%\Common Files\microsoft shared\VSTT\Cross Browser Selenium Components”(适用于 64 位机器)

再次使用 BrowserWindow.CurrentBrowser = "Chrome" 启动 Chrome,消息应该消失了。

【讨论】:

  • 谢谢,使用 chromedriver 2.12,问题没有出现。
猜你喜欢
  • 2018-08-11
  • 2014-08-01
  • 2014-09-12
  • 1970-01-01
  • 1970-01-01
  • 2015-11-09
  • 2014-07-21
  • 2017-09-14
  • 2017-06-27
相关资源
最近更新 更多