gpt4 book ai didi

appium - XCUITest 并不总是以错误 ECONNREFUSED 开始

转载 作者:行者123 更新时间:2023-12-05 06:59:35 28 4
gpt4 key购买 nike

我正在尝试在 iOS 上运行一些 appium 测试,似乎有一半时间 WebDriverAgent 从未启动。我在 appium 日志中一遍又一遍地收到此错误:

[debug] [simctl] WD Proxy Matched '/status' to command name 'getStatus'
[debug] [simctl] WD Proxy Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[simctl] WD Proxy connect ECONNREFUSED 127.0.0.1:8100
[debug] [simctl] WD Proxy Matched '/status' to command name 'getStatus'
[debug] [simctl] WD Proxy Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[simctl] WD Proxy connect ECONNREFUSED 127.0.0.1:8100
[debug] [simctl] WD Proxy Matched '/status' to command name 'getStatus'
[debug] [simctl] WD Proxy Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[simctl] WD Proxy connect ECONNREFUSED 127.0.0.1:8100

在这种情况发生一段时间后,我将重新启动服务器并重试。通常情况下,我会多次遇到该错误,但随后 WebDriverAgent 服务器将启动:

debug] [simctl] WD Proxy Matched '/status' to command name 'getStatus'
[debug] [simctl] WD Proxy Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[simctl] WD Proxy connect ECONNREFUSED 127.0.0.1:8100
[debug] [simctl] WD Proxy Matched '/status' to command name 'getStatus'
[debug] [simctl] WD Proxy Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[simctl] WD Proxy connect ECONNREFUSED 127.0.0.1:8100
[debug] [simctl] WD Proxy Matched '/status' to command name 'getStatus'
[debug] [simctl] WD Proxy Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[simctl] WD Proxy connect ECONNREFUSED 127.0.0.1:8100
[debug] [simctl] WebDriverAgent Log file for xcodebuild test: /Users/kroe761/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu/Logs/Test/Test-WebDriverAgentRunner-2020.10.15_11-20-17--0500.xcresult/Staging/2_Test/Diagnostics/WebDriverAgentRunner-27B846BD-B71B-4DA7-910B-ABEB46E5890F/WebDriverAgentRunner-7B63C34A-8F4F-4B67-AD6F-3F34C50C4DF1/Session-WebDriverAgentRunner-2020-10-15_112018-MRGyT7.log
[debug] [simctl] WD Proxy Matched '/status' to command name 'getStatus'
[debug] [simctl] WD Proxy Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[simctl] WD Proxy connect ECONNREFUSED 127.0.0.1:8100
[debug] [simctl] WD Proxy Matched '/status' to command name 'getStatus'
[debug] [simctl] WD Proxy Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [simctl] WD Proxy Got response with status 200: {"value":{"message":"WebDriverAgent is ready to accept commands","state":"success","os":{"testmanagerdVersion":28,"name":"iOS","sdkVersion":"14.0","version":"14.0"},"ios":{"simulatorVersion":"14.0","ip":"172.21.99.125"},"ready":true,"build":{"upgradedAt":"1602686780985","time":"Oct 15 2020 10:58:44","productBundleIdentifier":"com.facebook.WebDriverAgentRunner"}},"sessionId":null}
[debug] [simctl] WebDriverAgent WebDriverAgent information:
[debug] [simctl] WebDriverAgent {
[debug] [simctl] WebDriverAgent "message": "WebDriverAgent is ready to accept commands",
[debug] [simctl] WebDriverAgent "state": "success",
[debug] [simctl] WebDriverAgent "os": {
[debug] [simctl] WebDriverAgent "testmanagerdVersion": 28,
[debug] [simctl] WebDriverAgent "name": "iOS",
[debug] [simctl] WebDriverAgent "sdkVersion": "14.0",
[debug] [simctl] WebDriverAgent "version": "14.0"
[debug] [simctl] WebDriverAgent },
[debug] [simctl] WebDriverAgent "ios": {
[debug] [simctl] WebDriverAgent "simulatorVersion": "14.0",
[debug] [simctl] WebDriverAgent "ip": "172.xx.xx.xxx"
[debug] [simctl] WebDriverAgent },
[debug] [simctl] WebDriverAgent "ready": true,
[debug] [simctl] WebDriverAgent "build": {
[debug] [simctl] WebDriverAgent "upgradedAt": "1602686780985",
[debug] [simctl] WebDriverAgent "time": "Oct 15 2020 10:58:44",
[debug] [simctl] WebDriverAgent "productBundleIdentifier": "com.facebook.WebDriverAgentRunner"
[debug] [simctl] WebDriverAgent }
[debug] [simctl] WebDriverAgent }
[debug] [simctl] WebDriverAgent WebDriverAgent successfully started after 5889ms
[debug] [simctl] BaseDriver Event 'wdaSessionAttempted' logged at 1602778820361 (11:20:20 GMT-0500 (Central Daylight Time))
[debug] [simctl] XCUITest Sending createSession command to WDA
[debug] [simctl] WD Proxy Matched '/session' to command name 'createSession'

我绝对讨厌“有时会发生这种情况”的问题,但我已经研究了好几天了,还是没有答案。任何帮助将不胜感激!

编辑:这是我的帽子:

caps = {
platformName: :ios,
deviceName: "iPhone 11",
automationName: "XCUITest",
app: "/path/to/app",
sendKeyStrategy: "setValue",
showXcodeLog: true,
useNewWDA: true
}

最佳答案

即使这是 Tosca 文档,这也可能有助于解释为什么 @Vault23 可能使用他的提示是正确的

useNewWDA: true 和 usePrebuiltWDA: true

https://documentation.tricentis.com/tosca/1340/en/content/engines_3.0/mobile/tbox_mobileweb_set_appium_capabilities.htm

添加以上两个功能使我使用 Appium 和 iPhone 的本地模拟器进行的本地移动测试变得更加稳定和可重复。虽然我必须承认,但我不明白为什么。

关于appium - XCUITest 并不总是以错误 ECONNREFUSED 开始,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64375973/

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