When using the Appium Desktop inspector on iOS, I get the following error when refreshing the source after adding { "snapshotMaxDepth":63 }
to the session. Anything greater than 62 results in this error.
[info] e[35m[HTTP]e[39m e[37m<-- POST /wd/hub/session/bb6bd6b0-f146-44e1-b241-e5094317efac/execute e[39me[32m200e[39m e[90m9615 ms - 93e[39m
[info] e[35m[HTTP]e[39m e[90me[39m
[info] e[35m[HTTP]e[39m e[37m-->e[39m e[37mGETe[39m e[37m/wd/hub/session/bb6bd6b0-f146-44e1-b241-e5094317efac/sourcee[39m
[info] e[35m[HTTP]e[39m e[90m{}e[39m
[debug] e[35m[MJSONWP (bb6bd6b0)]e[39m Calling AppiumDriver.getPageSource() with args: ["bb6bd6b0-f146-44e1-b241-e5094317efac"]
[debug] e[35m[XCUITest]e[39m Executing command 'getPageSource'
[debug] e[35m[WD Proxy]e[39m Matched '/source' to command name 'getPageSource'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /source] to [GET http://127.0.0.1:8100/session/C122FCAD-BA5F-4150-9D86-838D6C222EBA/source] with no body[info] e[35m[WD Proxy]e[39m Got response with status 404: {"value":{"error":"stale element reference","message":"The previously found element \"Application 'com.boomin.customer'\" is not present in the current view anymore. Make sure the application UI has the expected state. Original error: Error kAXErrorIllegalArgument getting snapshot for element <AXUIElementRef 0x1584061d0> {pid=11089} {uid=[ID:1 hash:0x0]}","traceback":"(\n\t0 CoreFoundation 0x000000010d8ddfba __exceptionPreprocess + 242\n\t1 libobjc.A.dylib 0x000000010d787ff5 objc_exception_throw + 48\n\t2 WebDriverAgentLib 0x0000000133f61e45 -[XCUIElement(FBUtilities) fb_takeSnapshot] + 1077\n\t3 WebDriverAgentLib 0x0000000133f620fb -[XCUIElement(FBUtilities) fb_snapshotWithAttributes:maxDepth:] + 187\n\t4 WebDriverAgentLib 0x0000000133eff6a9 +[FBXPath writeXmlWithRootElement:indexPath:elementStore:includedAttributes:writer:] + 937\n\t5 WebDriverAgentLib 0x0000000133efe9d9 +[FBXPath ...
[debug] e[35m[W3C]e[39m Matched W3C error code 'stale element reference' to StaleElementReferenceError
[debug] e[35m[MJSONWP (bb6bd6b0)]e[39m Encountered internal error running command: StaleElementReferenceError: The previously found element "Application 'com.boomin.customer'" is not present in the current view anymore. Make sure the application UI has the expected state. Original error: Error kAXErrorIllegalArgument getting snapshot for element <AXUIElementRef 0x1584061d0> {pid=11089} {uid=[ID:1 hash:0x0]}
[debug] e[35m[MJSONWP (bb6bd6b0)]e[39m at errorFromW3CJsonCode (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:780:25)
[debug] e[35m[MJSONWP (bb6bd6b0)]e[39m at ProxyRequestError.getActualError (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:663:14)
[debug] e[35m[MJSONWP (bb6bd6b0)]e[39m at JWProxy.command (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:272:19)
[debug] e[35m[MJSONWP (bb6bd6b0)]e[39m at runMicrotasks (<anonymous>)
[debug] e[35m[MJSONWP (bb6bd6b0)]e[39m at processTicksAndRejections (internal/process/task_queues.js:85:5)
[info] e[35m[HTTP]e[39m e[37m<-- GET /wd/hub/session/bb6bd6b0-f146-44e1-b241-e5094317efac/source e[39me[31m500e[39m e[90m86 ms - 388e[39m
Prior to adding this setting, I can navigate round my app and refresh the source without any errors. After adding the setting, I get the same error everytime I attempt to move to a different page in the app and refresh the source.
Iāve tried a direct api call to /appium/settings
instead of using the GUI and I get the same problem. Iāve also tried adding ācustomSnapshotTimeoutā and a few other settings but nothing helps.
Itās a react native .app
file created with expo. Iāve tested with a fresh react native expo app and it doesnāt have this problem. My capabilities are as followsā¦
{
"platformName": "iOS",
"deviceName": "iPhone 12 Pro Max",
"app": "/Users/matthewoconnor/Downloads/Boomin.app",
"automationName": "XCUITest"
}
I canāt share the app file publicly but can share it privately if it looks like there might be a genuine bug that can be investigated.