appium-XUITest并不总是以错误ECONREFUSE开始

appium-XUITest并不总是以错误ECONREFUSE开始,appium,xcuitest,simctl,Appium,Xcuitest,Simctl,我正在尝试在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]

我正在尝试在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
}

请把你的能力也贴出来。每次运行测试时是否都重新安装webdriver?我添加了CAP。是的,我每次都试图重新安装webdriver runner。请不要通过设置为caps lile:useNewWDA:true和usePrebuiltWDA:true来重新安装webdriver。也请发布您的功能。每次运行测试时是否都重新安装webdriver?我添加了CAP。是的,我每次都尝试重新安装webdriver runner。通过设置为caps lile:useNewWDA:true和usePrebuiltWDA:true,尝试不重新安装webdriver