WebDriver:ChromeDriver 尝试在初始化时访问 http://localhost/session 并失败 [英] WebDriver: ChromeDriver attempting to reach http://localhost/session on initialization and failing

查看:69
本文介绍了WebDriver:ChromeDriver 尝试在初始化时访问 http://localhost/session 并失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

完整的错误信息是:

 测试失败.OpenQA.Selenium.WebDriverException :对 URL http://localhost:59662/session 的远程 WebDriver 服务器的 HTTP 请求在 60 秒后超时.---->System.Net.WebException : 操作已超时

我的代码中发生这种情况的行只是实例化一个新的 ChromeDriver 实例:

CurrentDriver = new ChromeDriver(section["chromedriverfolder"]);

所以我的问题是...为什么新的 ChromeDriver 会调用/session URL,以及可能导致它失败的原因是什么?

解决方案

我在 TeamCity 9.x 上使用 Selenium.WebDriver.ChromeDriver v2.22 和 Chrome v52.0.2743.116 m 时遇到了同样的错误.我能够通过将 TeamCity 代理上运行的 Chrome 版本回滚到 v51 来解决该问题.

检查执行测试的代理时,会弹出一个错误消息:Chrome 自动化扩展程序已崩溃.单击此气球可重新加载扩展程序."

这似乎是最新版本的 Chrome 和 Selenium.WebDriver.ChromeDriver 的一个错误,但到目前为止这是我唯一的线索 找到

ChromeDriver 问题的链接

解决方案的链接

The full error message is:

 Test(s) failed. OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://localhost:59662/session timed out after 60 seconds.
  ----> System.Net.WebException : The operation has timed out

The line in my code where this is happening simply instances a new ChromeDriver instance:

CurrentDriver = new ChromeDriver(section["chromedriverfolder"]);

So my question is... why does a new ChromeDriver invokes the /session URL, and what could be causing it to fail?

解决方案

I experienced this same error using Selenium.WebDriver.ChromeDriver v2.22 and Chrome v52.0.2743.116 m running on TeamCity 9.x. I was able to fix the problem by rolling back the version of Chrome running on the TeamCity agents to v51.

When examining the agent executing the test, there is a popup with error: "Chrome Automation extension has crashed. Click this balloon to reload the extension."

It seems like a bug with the latest version of Chrome and Selenium.WebDriver.ChromeDriver, but as of yet this is the only lead I've found

EDIT: The link to the ChromeDriver issue

EDIT2: The link to the resolution

这篇关于WebDriver:ChromeDriver 尝试在初始化时访问 http://localhost/session 并失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆