Selenium WebDriverException:消息:未知错误:无法根据未知错误确定加载状态:缺少或无效的“entry.level"

问题描述

我有一个使用 selenium 进行测试的脚本.现在甚至使用

I have a script which uses selenium for testing. Now even opening a Google page using

driver.get(url) # url = Google homepage url

给我下面的错误

driver.get("https://my.gumtree.com/login")
File "C:Python34libsite-packagesseleniumwebdriveremotewebdriver.py", line 245, in get
self.execute(Command.GET, {'url': url})
File "C:Python34libsite-packagesseleniumwebdriveremotewebdriver.py", line 233, in execute
self.error_handler.check_response(response)
File "C:Python34libsite-packagesseleniumwebdriveremoteerrorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot determine loading status
from unknown error: missing or invalid 'entry.level'
(Session info: chrome=65.0.3315.3)
(Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.16299 x86_64)

我有 Google chrome 版本 65、Chromedriver 2.35 和 selenium 2.53.1

I have Google chrome version 65, Chromedriver 2.35 and selenium 2.53.1

我根据其他类似问题中提到的解决方案尝试了不同的版本组合(在下表中提到),但没有任何效果.

I tried different version combinations(mentioned in below table) as per solutions mentioned in other similar questions but nothing worked.

Selenium      Chrome      Chromedriver
2.53.0        63           2.33
2.53.1        65(latest)   2.34
3.6.0                      2.35(latest)
3.7.0
3.8.0
3.8.1(latest)

编辑 1:JDK 版本

EDIT 1: JDK version

java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)


解决方案

错误说明了一切:

selenium.common.exceptions.WebDriverException: Message: unknown error: cannot determine loading status
from unknown error: missing or invalid 'entry.level'

您的主要问题是您使用的二进制文件之间的版本兼容性,如下所示:

Your main issue is the version compatibility among the binaries you are using as follows :

  • 您正在使用 chromedriver=2.29.461591(根据日志,尽管您在问题中提到了 Chromedriver 2.35)
  • chromedriver=2.29.461591 明确提及以下内容:
  • You are using chromedriver=2.29.461591 (which is as per the logs, though you mentioned Chromedriver 2.35 in your question)
  • Release Notes of chromedriver=2.29.461591 clearly mentions the following :

支持 Chrome v56-58

  • 您正在使用 chrome=65.0.3315.3
  • chromedriver=2.35的发行说明 明确提及以下内容:
    • You are using chrome=65.0.3315.3
    • Release Notes of chromedriver=2.35 clearly mentions the following :
    • 支持 Chrome v62-64

      • 您使用的是 Selenium 版本 2.53.1.
      • 我们不知道您的 JDK 版本.
        • JDK 升级到最新级别 JDK 版本 8 更新 151.
        • ChromeDriver 升级到 ChromeDriver v2.35 级别.
        • Chrome 保持在 Chrome v64.x 级别.(根据 ChromeDriver v2.35 发行说明)
        • Selenium 升级到当前级别 Version 3.8.1.
        • 从您的 IDE 中清理 Project Workspace &全部重建.
        • 运行 CCleaner 工具来清除所有操作系统杂务.
        • 如果您的 Chrome 基础版本太旧,请通过 Revo Uninstaller 卸载 Chrome 并安装最新的 GA Release 版本的 Chrome.
        • 进行一次系统重启.
        • 执行您的测试.
        • Upgrade JDK to recent levels JDK Version 8 Update 151.
        • Upgrade ChromeDriver to ChromeDriver v2.35 level.
        • Keep Chrome to Chrome v64.x levels. (as per ChromeDriver v2.35 release notes)
        • Upgrade Selenium to current levels Version 3.8.1.
        • Clean the Project Workspace from your IDE & Rebuild All.
        • Run CCleaner tool to wipe off all the OS chores.
        • If your Chrome base version is too old, uninstall Chrome through Revo Uninstaller and install a recent GA Release version of Chrome.
        • Take a System Reboot.
        • Execute your Test.

相关文章