I can't get Xpath to work in Appium 2 with LambdaTest

lambda-logs-appium-APPTESnXX8R9lutqIDa80L (1).txt (135.4 KB)
Hi, I’m trying to find an element using xpath getting an error:

"2024-05-31 09:55:28:694 [HTTP] {\"using\":\"xpath\",\"value\":\"//XCUIElementTypeTextField[@value=\\\"User Id\\\"]\"}",
    "2024-05-31 09:55:28:695 [XCUITestDriver@7306 (202d3bac)] Calling AppiumDriver.findElements() with args: [\"xpath\",\"//XCUIElementTypeTextField[@value=\\\"User Id\\\"]\",\"202d3bac-b548-4fbb-9055-ef7ac0ce4919\"]",
    "2024-05-31 09:55:28:695 [XCUITestDriver@7306 (202d3bac)] Executing command 'findElements'",
    "2024-05-31 09:55:28:695 [XCUITestDriver@7306 (202d3bac)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector",
    "2024-05-31 09:55:28:695 [XCUITestDriver@7306 (202d3bac)] Waiting up to 0 ms for condition",
    "2024-05-31 09:55:28:696 [XCUITestDriver@7306 (202d3bac)] Matched '/elements' to command name 'findElements'",
    "2024-05-31 09:55:28:696 [XCUITestDriver@7306 (202d3bac)] Proxying [POST /elements] to [POST] with body: {\"using\":\"xpath\",\"value\":\"//XCUIElementTypeTextField[@value=\\\"User Id\\\"]\"}",
    "2024-05-31 09:55:28:906 [XCUITestDriver@7306 (202d3bac)] Got response with status 500: {\"value\":{\"error\":\"unknown error\",\"message\":\"Invalid key path fb_uid specified in predicate format string\",\"traceback\":\"(\\n\\t0   CoreFoundation                      0x000000018bb8a254 46D12E27-013C-3163-AAE8-FCD375FD9054 + 41556\\n\\t1   libobjc.A.dylib                     0x0000000184fbba68 objc_exception_throw + 60\\n\\t2   XCTAutomationSupport                0x0000000103030588 +[XCTElementQueryTransformerPredicateValidator validatePredicate:withBlocksAllowed:] + 412\\n\\t3   XCTAutomationSupport                0x000000010303bdc4 -[XCTElementFilteringTransformer initWithScope:predicate:] + 140\\n\\t4   XCUIAutomation                      0x0000000102d3dbf0 -[XCUIElementQuery _queryWithPredicate:description:] + 80\\n\\t5   XCUIAutomation                      0x0000000102d3dcb0 -[XCUIElementQuery _queryWithPredicate:] + 96\\n\\t6   WebDriverAgentLib                   0x00000001065fb9e0 -[XCUIElement(FBUtilities) fb_filterDescendantsWithSnapshots:selfUID:onlyChildren:] + 1996\\n\\t7   WebDriverAgentLib                   ...",
    "2024-05-31 09:55:28:906 [W3C] Matched W3C error code 'unknown error' to UnknownError",
    "2024-05-31 09:55:28:906 [XCUITestDriver@7306 (202d3bac)] Responding to client with driver.findElements() result: []",

I assume it’s an issue with the cloud provider

Something more specific so I can ask the team to look at?

Have you tried reporting it to the customer support?

Yes, they raised their hands.

That’s unfortunate. Are you able to reproduce the issue locally with the latest driver version?

We don’t own access to this app. That’s the reason we had a cloud provider in first place.

Hi @Vivek_Burman
Let me try and get to the bottom of this. It could be related to less wait time added before the xpath used.

@mykola-mokhnach - I can see that Appium 2.2.1 was used in this session with driver [email protected] on an iOS 16 device. Do you have any suggestions on where to look further?