gpt4 book ai didi

node.js - 网络驱动程序错误: cannot find dict 'desiredCapabilities'

转载 作者:太空宇宙 更新时间:2023-11-04 02:15:04 27 4
gpt4 key购买 nike

我正在使用 selenium webdriver v2.53 和 nodeJS v5.5,使用此组合,chrome 驱动程序可以正常工作,没有任何问题,当我添加 mocha(v2.4.5)+chai 时,我收到以下错误堆栈

 WebDriverError: unknown error: cannot find dict 'desiredCapabilities'
(Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 6.1 SP1 x86_64)
at WebDriverError (D:\webrtc\licode-prototype\node_modules\selenium-webdriver\lib\error.js:26:26)
at Object.checkLegacyResponse (D:\webrtc\licode-prototype\node_modules\selenium-webdriver\lib\error.js:639:15)
at parseHttpResponse (D:\webrtc\licode-prototype\node_modules\selenium-webdriver\http\index.js:529:13)
at D:\webrtc\licode-prototype\node_modules\selenium-webdriver\http\index.js:466:11
at ManagedPromise.invokeCallback_ (D:\webrtc\licode-prototype\node_modules\selenium-webdriver\lib\promise.js:1343:14)
at TaskQueue.execute_ (D:\webrtc\licode-prototype\node_modules\selenium-webdriver\lib\promise.js:2868:14)
at TaskQueue.executeNext_ (D:\webrtc\licode-prototype\node_modules\selenium-webdriver\lib\promise.js:2851:21)
at D:\webrtc\licode-prototype\node_modules\selenium-webdriver\lib\promise.js:2775:25
at D:\webrtc\licode-prototype\node_modules\selenium-webdriver\lib\promise.js:639:7
at run (D:\webrtc\licode-prototype\node_modules\esdoc\node_modules\core-js\modules\es6.promise.js:89:39)
at D:\webrtc\licode-prototype\node_modules\esdoc\node_modules\core-js\modules\es6.promise.js:100:28
From: Task: WebDriver.createSession()
at acquireSession (D:\webrtc\licode-prototype\node_modules\selenium-webdriver\lib\webdriver.js:107:22)
at Function.createSession (D:\webrtc\licode-prototype\node_modules\selenium-webdriver\lib\webdriver.js:338:12)
at Driver (D:\webrtc\licode-prototype\node_modules\selenium-webdriver\chrome.js:778:38)
at MyDriver (D:\webrtc\licode-prototype\test1\helper.js:44:16)
at Context.<anonymous> (D:\webrtc\licode-prototype\test1\homepage.js:11:27)
at callFn (D:\webrtc\licode-prototype\node_modules\mocha\lib\runnable.js:315:21)
at Hook.Runnable.run (D:\webrtc\licode-prototype\node_modules\mocha\lib\runnable.js:308:7)
at next (D:\webrtc\licode-prototype\node_modules\mocha\lib\runner.js:298:10)
at Immediate._onImmediate (D:\webrtc\licode-prototype\node_modules\mocha\lib\runner.js:320:5)
From: Task: WebDriver.navigate().to(https://localhostviewer?id=u7N5ZX4&room=4FOM1dA)
at MyDriver.schedule (D:\webrtc\licode-prototype\node_modules\selenium-webdriver\lib\webdriver.js:387:17)
at Navigation.to (D:\webrtc\licode-prototype\node_modules\selenium-webdriver\lib\webdriver.js:1030:25)
at MyDriver.get (D:\webrtc\licode-prototype\node_modules\selenium-webdriver\lib\webdriver.js:798:28)
at MyDriver.joinRTC (D:\webrtc\licode-prototype\test1\helper.js:78:17)

我将问题追溯到 this github issue ,有人能告诉我如何解决吗?

最佳答案

您可能已经重新配置了测试框架。

在幕后,您的框架应该像这样对运行的 WebDriver 执行 POST 请求(示例):

curl -XPOST http://localhost:4444/wd/hub/session -d '{"desiredCapabilities":{"browserName":"chrome","browserstack.selenium_version":"2.45.0","screen-resolution":"1280x1024","name":"tests/intern.js","idle-timeout":60}}'

因此它应该提供 desiredCapability 作为 POST 参数。

根据您的错误,这不会发生。

关于node.js - 网络驱动程序错误: cannot find dict 'desiredCapabilities' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36145919/

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