我定期更新 Firefox 和 Chrome 浏览器,当前版本 54.0.1 32 位 所以要使用哪个版本的 Geckodriver。
我尝试了两个版本 Geckodriver-v0.18.0 and geckodriver-v0.16.1
供将来引用,我在哪里可以找到支持的具有相应 geckodriver 版本的 Firefox 浏览器列表
注意:启动浏览器中没有任何代码更改
以前的代码使用 geckodriver-v0.16.1 用于旧版本的 firefox
现在更新 firefox 54.0.1 和 Geckodriver-v0.18.0 后出现异常:
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: oundUpdates":1,"bootstrap":false,"skinnable":false,"size":3242616,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":true,"hasBinaryComponents":false,"strictCompatibility":false,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"1.5","maxVersion":"9.9"}],"targetPlatforms":[],"multiprocessCompatible":false,"signedState":0,"seen":true,"dependencies":[],"hasEmbeddedWebExtension":false,"mpcOptedOut":false,"userPermissions":null}
最佳答案
自从我们从旧版 Firefox 迁移到 以来,这个问题已经经常出现一段时间了。木偶 基于 Mozilla Firefox 版本(从 Firefox 48 开始)。目前尚不清楚您所说的代码与 geckodriver-v0.16.1 用于较旧的 firefox 版本的确切含义。
通常,每个 GeckoDriver 版本都支持每个版本的 Mozilla Firefox 版本(从 Firefox 48 开始),其中属性 木偶需要设置为 true
(默认或通过配置)
如果您使用的是旧版 Firefox(直到 Firefox 47.x),GeckoDriver 仍然可以工作,但您必须明确设置属性 木偶至 false
现在,唯一存在的依赖关系是 GeckoDriver 和 Selenium 版本之间。 GeckoDriver 发行说明清楚地提到了所有主要/次要 新增功能 , 增强功能 , 错误修复 和 下载地址 分别在 this link .
最后宣布的依赖是:
Note that
geckodriver v0.16.0
is only compatible withSelenium 3.4 and greater
.
GeckoDriver, Selenium and Firefox Browser compatibility chart
关于selenium - 给定的 Geckodriver 版本支持哪些 Firefox 浏览器版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54138740/