作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
您好,我正在尝试对我的 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 未初始化。
您的主要问题是您使用的二进制文件之间的版本兼容性,如下所示:
Supports Chrome v56-58
Supports Chrome v62-64
因此 ChromeDriver v2.29 和 Chrome 浏览器 v64.0 之间明显不匹配
@Test
。关于linux - 错误未知错误 : missing or invalid 'entry.level' while executing Nigthwatch. js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49305686/
您好,我正在尝试对我的 stagin 环境运行基本测试。相同的通用测试适用于谷歌,但不适用于我的暂存环境。这是测试: browser.url('https://google.com') .execut
我是一名优秀的程序员,十分优秀!