appium+iOS 自動化測試報錯 XCUIApplicationProcess waitForQuiescenceIncludingAnimationsIdle

riginnnn發表於2024-12-26

有使用 appium 日常執行 iOS 自動化的大佬嗎
小弟做了一個 appium 的自動化測試,一直都正常執行,某天開始突然執行 TouchAction 的程式碼後報錯,排查了很多問題,我 xcode、appium 版本、iOS 版本都沒有變,是不是 wda 還是 appium 某個底層 api 變了呀

appium:2.0.1
xcode:15.2
iOS:17.2.1
wda:5.6.0

我使用另外一套裝置 appium1.22.3/xcode16.2/iOS18.2/都交叉試過了 一樣報相同的錯誤

執行的程式碼

for _ in range(3):
        TouchAction(self.driver).press(x=200, y=100).wait(200).move_to(x=100, y=100).release().perform()

報錯

>       raise exception_class(message, screen, stacktrace)
E       selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: -[XCUIApplicationProcess waitForQuiescenceIncludingAnimationsIdle:]: unrecognized selector sent to instance 0x30154e500
E       Stacktrace:
E       UnknownError: An unknown server-side error occurred while processing the command. Original error: -[XCUIApplicationProcess waitForQuiescenceIncludingAnimationsIdle:]: unrecognized selector sent to instance 0x30154e500
E           at errorFromW3CJsonCode (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:780:25)
E           at ProxyRequestError.getActualError (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:663:14)
E           at JWProxy.command (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:272:19)
E           at runMicrotasks (<anonymous>)
E           at processTicksAndRejections (internal/process/task_queues.js:97:5)
E           at XCUITestDriver.proxyCommand (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/proxy-helper.js:96:12)
E           at XCUITestDriver.performTouch (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/gesture.js:141:12)

/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py:245: WebDriverException

appium 的日誌

[XCUITest] Executing command 'performTouch'
[XCUITest] Received the following touch action: press(options={"x":200,"y":100})-wait(options={"ms":200})-moveTo(options={"x":100,"y":100})-release(options={})
[WD Proxy] Proxying [POST /wda/touch/perform] to [POST http://127.0.0.1:8100/session/7FB38A6F-5271-4D37-AAFD-1593D1BC9CE6/wda/touch/perform] with body: {"actions":[{"action":"press","options":{"x":200,"y":100}},{"action":"wait","options":{"ms":200}},{"action":"moveTo","options":{"x":100,"y":100}},{"action":"release","options":{}}]}
[WD Proxy] Got response with status 500: {"value":{"error":"unknown error","message":"-[XCUIApplicationProcess waitForQuiescenceIncludingAnimationsIdle:]: unrecognized selector sent to instance 0x302f33780","traceback":"(\n\t0   CoreFoundation                      0x000000018d2955f8 6A60BE13-E657-3BEC-A9AC-BA239AE29862 + 185848\n\t1   libobjc.A.dylib                     0x000000018a811244 objc_exception_throw + 88\n\t2   CoreFoundation                      0x000000018d3ee174 6A60BE13-E657-3BEC-A9AC-BA239AE29862 + 1597812\n\t3   CoreFoundation                      0x000000018d2985b8 6A60BE13-E657-3BEC-A9AC-BA239AE29862 + 198072\n\t4   CoreFoundation                      0x000000018d297ee0 _CF_forwarding_prep_0 + 96\n\t5   WebDriverAgentLib                   0x0000000108fbbd10 -[XCUIElement(FBUtilities) fb_waitUntilStableWithTimeout:] + 308\n\t6   WebDriverAgentLib                   0x0000000108f769d8 -[XCUIApplication(FBTouchAction) fb_performAppiumTouchActions:elementCache:error:] + 196\n\t7   WebDriverAgentLib                   0x0000000108fb433...
[W3C] Matched W3C error code 'unknown error' to UnknownError
[W3C (ea7c4fbe)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: -[XCUIApplicationProcess waitForQuiescenceIncludingAnimationsIdle:]: unrecognized selector sent to instance 0x302f33780
[W3C (ea7c4fbe)]     at errorFromW3CJsonCode (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:780:25)
[W3C (ea7c4fbe)]     at ProxyRequestError.getActualError (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:663:14)
[W3C (ea7c4fbe)]     at JWProxy.command (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:272:19)
[W3C (ea7c4fbe)]     at runMicrotasks ()
[W3C (ea7c4fbe)]     at processTicksAndRejections (internal/process/task_queues.js:97:5)
[W3C (ea7c4fbe)]     at XCUITestDriver.proxyCommand (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/proxy-helper.js:96:12)
[W3C (ea7c4fbe)]     at XCUITestDriver.performTouch (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/gesture.js:141:12)
[HTTP] <-- POST /wd/hub/session/ea7c4fbe-b8c2-4cdb-97c7-cf51d1353133/touch/perform 500 557 ms - 1491
[HTTP] 
[HTTP] Request idempotency key: 36a0d3a6-f6cf-4765-a3f8-d399000e540f
[HTTP] --> POST /wd/hub/session

相關文章