Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snapshotMaxDepth value over 62 fails on certain pages #749

Open
shreynolds3 opened this issue Aug 3, 2023 · 1 comment
Open

snapshotMaxDepth value over 62 fails on certain pages #749

shreynolds3 opened this issue Aug 3, 2023 · 1 comment

Comments

@shreynolds3
Copy link

Issue: Receiving 'Stale element reference' message when attempting to load screenshot using Appium Inspector. The issue only occurs on this screen when snapshotMaxDepth value is over 62. If the value is 62 or under, the snapshot loads however I need to be able to use a higher value to access deeply nested elements.

NOTE: If I move the page to a level that is not so deeply nested, using a value over 62 works just fine (Tested up to 100). It appears the issue is related to how deeply nested the page exists.

I noticed in the source code for WDA, there is a comment in the XCUIElement+FBSCrolling.m file that states "Sometimes, attempting to grab the parent snapshot of the target cell after scrolling is complete causes a stale element reference exception.
" Not sure if this is relevant to this issue or not.

Error Message:
[WD Proxy] Got response with status 404: {"value":{"error":"stale element reference","message":"The previously found element \"Application '<redacted>'\" 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 0x600002db34b0> {pid=14312} {uid=[ID:1 hash:0x0]}","traceback":"(\n\t0 CoreFoundation 0x00000001111068ab __exceptionPreprocess + 242\n\t1 libobjc.A.dylib 0x000000011014eba3 objc_exception_throw + 48\n\t2 WebDriverAgentLib 0x00000001488afef3 -[XCUIElement(FBUtilities) fb_takeSnapshot] + 723\n\t3 WebDriverAgentLib 0x00000001488b01a7 -[XCUIElement(FBUtilities) fb_snapshotWithAttributes:maxDepth:] + 183\n\t4 WebDriverAgentLib 0x000000014886161a +[FBXPath writeXmlWithRootElement:indexPath:elementStore:includedAttributes:writer:] + 778\n\t5 WebDriverAgentLib 0x0000000148860c5b ... [debug] [W3C] Matched W3C error code 'stale element reference' to StaleElementReferenceError [debug] [W3C (39a89f32)] Encountered internal error running command: StaleElementReferenceError: The previously found element "Application '<redacted>'" 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 0x600002db34b0> {pid=14312} {uid=[ID:1 hash:0x0]} [debug] [W3C (39a89f32)] at errorFromW3CJsonCode (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:780:25) [debug] [W3C (39a89f32)] at ProxyRequestError.getActualError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:663:14) [debug] [W3C (39a89f32)] at JWProxy.command (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:272:19) [debug] [W3C (39a89f32)] at runMicrotasks (<anonymous>) [debug] [W3C (39a89f32)] at processTicksAndRejections (node:internal/process/task_queues:96:5) [debug] [W3C (39a89f32)] at XCUITestDriver.proxyCommand (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/proxy-helper.js:96:12) [debug] [W3C (39a89f32)] at XCUITestDriver.getNativePageSource (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/source.js:26:19) [debug] [W3C (39a89f32)] at XCUITestDriver.getPageSource (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/source.js:22:10) [HTTP] <-- GET /wd/hub/session/39a89f32-12b0-47db-aaef-7a3ec8c7faf0/source 404 53 ms - 1659 [HTTP] [HTTP] --> GET /wd/hub/session/39a89f32-12b0-47db-aaef-7a3ec8c7faf0/timeouts [HTTP] {} [debug] [W3C (39a89f32)] Calling AppiumDriver.getTimeouts() with args: ["39a89f32-12b0-47db-aaef-7a3ec8c7faf0"] [debug] [XCUITest] Executing command 'getTimeouts' [debug] [W3C (39a89f32)] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0} [HTTP] <-- GET /wd/hub/session/39a89f32-12b0-47db-aaef-7a3ec8c7faf0/timeouts 200 1 ms - 42 [HTTP]

@jlipps
Copy link
Member

jlipps commented Aug 4, 2023

Probably a duplicate of appium/appium#14825?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants