appium/appium-inspector

bug: getPageSource fails with 500 on xcode 16

zach-fetch opened this issue · 3 comments

Is this an issue specifically with Appium Inspector?

  • I have verified that my issue does not occur with Appium, and should be investigated as an Appium Inspector issue

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When I try to connect to an iOS simulator using the GUI appium inspector it will connect to the simulator, but it will fail to get the XML source to analyze.
The getPageSource call will fail with a 500

[XCUITestDriver@5adc] Calling AppiumDriver.getPageSource() with args: ["9006a9ca-715a-4c68-bbdf-7671f0755a9a"]
[XCUITestDriver@5adc] Executing command 'getPageSource'
[XCUITestDriver@5adc] Matched '/source?format=xml&scope=AppiumAUT' to command name 'getPageSource'
[XCUITestDriver@5adc] Proxying [GET /source?format=xml&scope=AppiumAUT] to [GET http://127.0.0.1:8100/session/43E3CC26-B1EC-4631-8C2D-C276D4AF0A75/source?format=xml&scope=AppiumAUT] with no body
[XCUITestDriver@5adc] Got response with status 500: {"value":{"error":"unknown error","message":"-[XCUIApplicationProcess waitForQuiescenceIncludingAnimationsIdle:]: unrecognized selector sent to instance 0x600002c2f800","traceback":"(\n\t0   CoreFoundation                      0x00000001804ae0f8 __exceptionPreprocess + 172\n\t1   libobjc.A.dylib                     0x0000000180087db4 objc_exception_throw + 56\n\t2   CoreFoundation                      0x00000001804c2f48 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0\n\t3   CoreFoundation                      0x00000001804b2248 ___forwarding___ + 1280\n\t4   CoreFoundation                      0x00000001804b456c _CF_forwarding_prep_0 + 92\n\t5   WebDriverAgentLib                   0x000000012af6ab14 -[XCUIElement(FBUtilities) fb_waitUntilStableWithTimeout:] + 308\n\t6   WebDriverAgentLib                   0x000000012af20454 +[FBXPath writeXmlWithRootElement:indexPath:elementStore:includedAttributes:writer:] + 632\n\t7   WebDriverAgentLib                   0x000000012af1fc14 +[FBXPath xmlRepre...
[W3C] Matched W3C error code 'unknown error' to UnknownError
[XCUITestDriver@5adc] 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 0x600002c2f800
    at errorFromW3CJsonCode (/Users/zachjohnson/.appium/node_modules/appium-xcuitest-driver/node_modules/@appium/base-driver/lib/protocol/errors.js:1085:25)
    at ProxyRequestError.getActualError (/Users/zachjohnson/.appium/node_modules/appium-xcuitest-driver/node_modules/@appium/base-driver/lib/protocol/errors.js:954:14)
    at JWProxy.command (/Users/zachjohnson/.appium/node_modules/appium-xcuitest-driver/node_modules/@appium/base-driver/lib/jsonwp-proxy/proxy.js:353:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at XCUITestDriver.proxyCommand (/Users/zachjohnson/.appium/node_modules/appium-xcuitest-driver/lib/commands/proxy-helper.js:109:35)
    at XCUITestDriver.mobileGetSource (/Users/zachjohnson/.appium/node_modules/appium-xcuitest-driver/lib/commands/source.js:50:35)
    at XCUITestDriver.getPageSource (/Users/zachjohnson/.appium/node_modules/appium-xcuitest-driver/lib/commands/source.js:25:9)
[HTTP] <-- GET /session/9006a9ca-715a-4c68-bbdf-7671f0755a9a/source 500 24 ms - 1447

This same error does not occur when I run on xcode 15.4.

Expected Behavior

Inspector should be able to get page source from simulator

Operating System

Mac

Appium Inspector Version

2024.9.1 and 2024.3.4

Appium Version

2.4.1

Further Information

Simulator is iPhone 15 iOS v 17.5
I am still able to use appium to connect to the simulators and run test automation. It is just the appium inspector that is not able to connect to the simulator.

Duplicate of #1700. Please upgrade your XCUITest driver to version >=7.24.15 and rebuild WDA.
Refer to the XCUITest documentation for compatibility.

Thank you for the investigation. Just for reference as to why people might be using older driver or appium versions 👇

We are unable to upgrade to that version. Browserstack, where we run all of our automation, does not support that version. We don't currently upgrade to a version higher than what is supported by them because it will start to cause issues with differences between tests run locally and tests run in browserstack.

Supported Appium and Driver Versions by Browserstack

Sure, that's absolutely reasonable. Though, I assume Browserstack and other cloud providers will upgrade to XCUITest >=7.24.15 in the near future, since earlier XCUITest versions do not support iOS 18.
In the meantime, if you don't need to test iOS 18, you can work around your issue by downgrading XCode to 15.4 or earlier.