selenium - 由于向后兼容性已被删除,如何使用 ChromeDriver 73 和 Chrome 版本 74 执行现有的 selenium 脚本?

标签 selenium google-chrome selenium-webdriver webdriver selenium-chromedriver

我面临一些有关 Selenium 脚本的问题。到目前为止,我使用的是 Chrome v73,它会自动更新到 v74。现在的问题是,当我尝试执行时代码没有执行。抛出以下错误。 有人可以建议如何执行吗?

Starting ChromeDriver 73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72) on port 36996
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created: Chrome version must be between 70 and 73
  (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 2.06 seconds

最佳答案

ChromeDriver - WebDriver for Chrome当前版本部分明确提到以下内容:

<小时/>

解决方案

如果您使用的是 Chrome v74.x,则必须使用 ChromeDriver v74.0.3729.6 作为强制措施。

<小时/>

ChromeDriver 放弃向后兼容性

John Chen(所有者 - chromedriver)最近确认:

Backward compatibility was dropped from ChromeDriver for a couple of reasons:

  • It adds complexity to the code, and is expensive to maintain.
  • It requires an infrastructure to test each build of ChromeDriver against multiple versions of Chrome. There is no such requirement anywhere else inside Chrome, and it became increasingly difficult to convince our build team to maintain such an infrastructure just for ChromeDriver.

I understand this creates difficulty for some of our users, but unfortunately it has become impossible for us to keep supporting the backward compatibility.

<小时/>

John Chen 的电子邮件快照

Chrome_backward

<小时/>

引用

您可以在以下位置找到相关的详细讨论:

关于selenium - 由于向后兼容性已被删除,如何使用 ChromeDriver 73 和 Chrome 版本 74 执行现有的 selenium 脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55956014/

相关文章:

html - CSS 下拉菜单隐藏在 Google Chrome 中的 Flash(仅)下。

javascript - Selenium 中图像验证的 NullPointerException

firefox - 如何使用 webdriver 查找 Firefox 配置文件路径

java - Action 类在 selenium webdriver 中以 Debug模式工作

java - 无法切换回默认框架

java - Selenium (Java) 无法通过可见链接文本找到元素

javascript - 停止 Chrome 扩展中的内容脚本

java - 如何使用命令行更改属性文件中的浏览器值来运行 selenium 测试用例

gwt - GWT 应用程序上的 Selenium 测试 - 请求未发送到服务器

Javascript - 隐藏扩展