appium-inspector icon indicating copy to clipboard operation
appium-inspector copied to clipboard

Stale element reference when inspect element in iOS Simulator 15.0

Open luckhiem opened this issue 2 years ago • 1 comments

Appium or Appium Desktop?

Appium Inspector

The problem

Currently when I start to inspect element in iOS Calendar App in first launch I'm facing problem stale element reference

{
  "platformName": "iOS",
  "appium:platformVersion": "15.0",
  "appium:deviceName": "iPhone 13",
  "appium:automationName": "XCUITest",
  "appium:app": "com.apple.mobilecal",
  "appium:snapshotMaxDepth": "65"
}
[WD Proxy] Got response with status 404: {"value":{"error":"stale element reference","message":"The previously found element \"Application 'com.apple.mobilecal'\" is not present in the current view anymore. Make sure the application UI has the expected state. Original error: Error getting main window kAXErrorServerNotFound","traceback":"(\n\t0   CoreFoundation                      0x00000001803e10e8 __exceptionPreprocess + 236\n\t1   libobjc.A.dylib                     0x0000000180193384 objc_exception_throw + 56\n\t2   WebDriverAgentLib                   0x0000000105030dd0 -[XCUIElement(FBUtilities) fb_takeSnapshot] + 908\n\t3   WebDriverAgentLib                   0x0000000105031030 -[XCUIElement(FBUtilities) fb_snapshotWithAttributes:maxDepth:] + 152\n\t4   WebDriverAgentLib                   0x0000000104fe8d9c +[FBXPath writeXmlWithRootElement:indexPath:elementStore:includedAttributes:writer:] + 692\n\t5   WebDriverAgentLib                   0x0000000104fe8598 +[FBXPath xmlRepresentationWithRootElement:writer:elementStore:query:excludingAttrib...
[debug] [W3C] Matched W3C error code 'stale element reference' to StaleElementReferenceError
[debug] [W3C (386ee0d7)] Encountered internal error running command: StaleElementReferenceError: The previously found element "Application 'com.apple.mobilecal'" is not present in the current view anymore. Make sure the application UI has the expected state. Original error: Error getting main window kAXErrorServerNotFound

Environment

  • I am running Appium Desktop version 2022.5.4
  • I am running Appium Server 1.22.3
  • I am on (pick one):
    • [ x] Mac: iOS 15

luckhiem avatar May 26 '22 03:05 luckhiem

Why do you think this is a problem with the Inspector?

jlipps avatar May 26 '22 19:05 jlipps

On the screen that opens in the application if there is a lot of data, appium will do it. This error will not be received if less data is found on the same screen. I hope appium fixes this problem one day. Tasks opened for this situation are closeing as an external system.

utkuozanocak avatar Dec 07 '22 12:12 utkuozanocak

Issue may be caused by the provided capabilities. appium:app requires a local path to an application file. com.apple.mobilecal is a bundle id, therefore appium:bundleId should be used. For now, closing due to no response.

eglitise avatar May 03 '23 06:05 eglitise