错误@wdio/runner:错误:无法创建会话



我开发了一些黄瓜测试,成功地通过并测试了一些带有chrome的url。然而,即使测试成功,webdriver在上传到管道时也会产生以下错误。

INFO webdriver: DATA {
57[0-0]   capabilities: {
58[0-0]     alwaysMatch: { browserName: 'chrome', acceptInsecureCerts: true },
59[0-0]     firstMatch: [ {} ]
60[0-0]   },
61[0-0]   desiredCapabilities: { browserName: 'chrome', acceptInsecureCerts: true }
62[0-0] }
ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:9515
64[0-0]     at ClientRequest.<anonymous> (/builds/zdf-cloud/fitness-functions/node_modules/got/dist/source/core/index.js:962:111)
65[0-0]     at Object.onceWrapper (events.js:418:26)
66[0-0]     at ClientRequest.emit (events.js:323:22)
67[0-0]     at ClientRequest.EventEmitter.emit (domain.js:482:12)
68[0-0]     at ClientRequest.origin.emit (/builds/zdf-cloud/fitness-functions/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
69[0-0]     at Socket.socketErrorListener (_http_client.js:426:9)
70[0-0]     at Socket.emit (events.js:311:20)
71[0-0]     at Socket.EventEmitter.emit (domain.js:482:12)
72[0-0]     at emitErrorNT (internal/streams/destroy.js:92:8)
73[0-0]     at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
74[0-0]     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)
75[0-0] 2022-02-18T10:21:26.227Z ERROR @wdio/runner: Error: Failed to create session.
76[0-0] Unable to connect to "http://localhost:9515/", make sure browser driver is running on that address.
77[0-0] If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
78[0-0]     at startWebDriverSession (/builds/zdf-cloud/fitness-functions/node_modules/webdriver/build/utils.js:72:15)
79[0-0]     at processTicksAndRejections (internal/process/task_queues.js:97:5)
80[0-0] FAILED in chrome - /src/cucumber/features/www/originCheck.feature
812022-02-18T10:21:26.343Z INFO @wdio/cli:launcher: Run onComplete hook
82Spec Files:    0 passed, 1 failed, 1 total (100% completed) in 00:00:11 
832022-02-18T10:21:26.345Z INFO @wdio/local-runner: Shutting down spawned worker
842022-02-18T10:21:26.596Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
852022-02-18T10:21:26.597Z INFO @wdio/local-runner: shutting down

我已经尝试使用webdriver mainsite中推荐的配置https://webdriver.io/docs/selenium-standalone-service/以及在其他论坛中描述的具有和不具有在wdio.conf.js:中实现的CCD_ 1和CCD_

capabilities: [{

maxInstances: 5,
browserName: 'chrome',
acceptInsecureCerts: true
}],
logLevel: 'info',

baseUrl: '',
waitforTimeout: 10000,

connectionRetryTimeout: 120000,

connectionRetryCount: 3,

services: 
[
['selenium-standalone', { drivers: { firefox: '0.29.1', chrome: true, chromiumedge: 'latest' } }],
['chromedriver',
{
logFileName: 'wdio-chromedriver.log',
outputDir: 'driver-logs',
chromedriverCustomPath: './chromedriver.exe'
}]
],

然而没有成功。我曾尝试将chromedriver降级为98.0.4758.102版本,并在管道中使用不同的docker映像,但却变成了"创建会话失败"问题对于如何通过使用chrome for webdriver来正确解决这个问题并避免会话创建错误,有什么建议吗?

WDIO V7,硒独立:7.20.3

如果browserName的功能不正确,则Microsoft Edge浏览器会出现以下问题:browserName:"edge">

正确名称:

browserName: 'microsoftEdge'

https://webdriver.io/docs/selenium-standalone-service/

相关内容

  • 没有找到相关文章

最新更新