gpt4 book ai didi

linux - 错误未知错误 : missing or invalid 'entry.level' while executing Nigthwatch. js

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:35:45 25 4
gpt4 key购买 nike

您好,我正在尝试对我的 stagin 环境运行基本测试。相同的通用测试适用于谷歌,但不适用于我的暂存环境。这是测试:

browser.url('https://google.com')
.execute(function () {

alert('this works');

});

当我在我的个人环境中运行这个测试时,我得到这个错误:

Running:  Test Project Play
INFO Request: POST /wd/hub/session
- data: {"desiredCapabilities":{"browserName":"chrome","javascriptEnabled":true,"acceptSslCerts":true,"platform":"ANY","chromeOptions":{"args":["ignore-certificate-errors","disable-web-security","ignore-certificate-errors"]},"name":"Test Project Play"}}
- headers: {"Content-Type":"application/json; charset=utf-8","Content-Length":245}
INFO Response 200 POST /wd/hub/session (1592ms) { status: 0,
sessionId: '104d0fe3600f4da9b8deddf0adc06b42',
value:
{ applicationCacheEnabled: false,
rotatable: false,
mobileEmulationEnabled: false,
networkConnectionEnabled: false,
chrome:
{ chromedriverVersion: '2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5)',
userDataDir: '/tmp/.org.chromium.Chromium.UszN4c' },
takesHeapSnapshot: true,
pageLoadStrategy: 'normal',
databaseEnabled: false,
handlesAlerts: true,
hasTouchScreen: false,
version: '64.0.3282.186',
platform: 'Linux',
browserConnectionEnabled: false,
nativeEvents: true,
acceptSslCerts: true,
locationContextEnabled: true,
webStorageEnabled: true,
browserName: 'chrome',
takesScreenshot: true,
javascriptEnabled: true,
cssSelectorsEnabled: true,
unexpectedAlertBehaviour: '',
'webdriver.remote.sessionid': '104d0fe3600f4da9b8deddf0adc06b42' } }
INFO Got sessionId from selenium 104d0fe3600f4da9b8deddf0adc06b42
INFO Request: POST /wd/hub/session/104d0fe3600f4da9b8deddf0adc06b42/url
- data: {"url":"https://app.bespotful.com/player/6940"}
- headers: {"Content-Type":"application/json; charset=utf-8","Content-Length":47}
INFO Response 200 POST /wd/hub/session/104d0fe3600f4da9b8deddf0adc06b42/url (3064ms) { sessionId: '104d0fe3600f4da9b8deddf0adc06b42',
status: 13,
value: { message: 'unknown error: cannot determine loading status\nfrom unknown error: missing or invalid \'entry.level\'\n (Session info: chrome=64.0.3282.186)\n (Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.13.0-36-generic x86_64)' } }
LOG → Completed command url (3068 ms)
INFO Request: POST /wd/hub/session/104d0fe3600f4da9b8deddf0adc06b42/execute
- data: {"script":"var passedArgs = Array.prototype.slice.call(arguments,0); return function () {\n\n alert('this works');\n\n }.apply(window, passedArgs);","args":[]}
- headers: {"Content-Type":"application/json; charset=utf-8","Content-Length":177}
ERROR Response 500 POST /wd/hub/session/104d0fe3600f4da9b8deddf0adc06b42/execute (296ms) { value:
{ message: 'java.net.ConnectException: Connection refused (Connection refused)',
error: 'unknown error' },
status: 13 }
LOG → Completed command execute (298 ms)
INFO FINISHED
No assertions ran.

我怀疑它是 cors 或 ssl 问题,但无法确认。

感谢任何线索。如果我找到答案,我会张贴在这里。

最佳答案

错误说明了一切:

INFO Response 200 POST /wd/hub/session/104d0fe3600f4da9b8deddf0adc06b42/url (3064ms) { sessionId: '104d0fe3600f4da9b8deddf0adc06b42',
status: 13,
value: { message: 'unknown error: cannot determine loading status\nfrom unknown error: missing or invalid \'entry.level\'\n (Session info: chrome=64.0.3282.186)\n (Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.13.0-36-generic x86_64)' } }

从您的错误堆栈跟踪中可以清楚地看出 Chrome 浏览器 session 未初始化。

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

  • 您正在使用 chromedriver=2.29
  • chromedriver=2.29 的发行说明明确提到以下内容:

Supports Chrome v56-58

  • 您正在使用 chrome=64.0
  • chromedriver=2.35 的发行说明明确提到以下内容:

Supports Chrome v62-64

因此 ChromeDriver v2.29Chrome 浏览器 v64.0 之间明显不匹配

解决方案

  • ChromeDriver 升级到最新级别 chromedriver=2.36 .
  • ChromeBrowser 升级到最新级别 chrome=65.x
  • 清理您的项目工作区,通过您的IDE重建您的项目,仅使用所需的依赖项。
  • 使用CCleaner用于在执行您的测试套件之前和之后清除所有操作系统杂务的工具。
  • 如果您的 ChromeBrowser 基础版本太旧,请通过 Revo Uninstaller 卸载它。并安装最新的 GA 和发布版本的 ChromeBrowser
  • 执行你的@Test

关于linux - 错误未知错误 : missing or invalid 'entry.level' while executing Nigthwatch. js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49305686/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com