java-client
java-client copied to clipboard
Can only retrieve text when searching for XPath on Appium iOS 12.4
Description
I'm trying to retrieve the text from an element on a iOS 12.4 app, using Java Client (v7.3.0) for Appium (v1.17.1), and iOS simulator.
When I search for the element using an ID, the retrieved text is empty, but when I search for the exact same element using a xPath, it retrieves the text as expected.
Driver.getDriver().findElement(By.name("foobar")).getText() = ""
Driver.getDriver().findElement(MobileBy.AccessibilityId("foobar")).getText() = ""
Driver.getDriver().findElement(By.xpath("//XCUIElementTypeTextField[@name=\"foobar\"]")).getText() = "expectedText"
When I retrieve the hash ID of the element using the previous methods, the ID is exactly the same, so it's the same element that is been found. The logs confirm this; they are the same for the different approaches, with the expected differences on the args of the request and the text's returned value.
Also, I don't have this issue on iOS 13.4.
Has anyone came across this scenario and know why it's happening?
Environment
- Java client 7.3.0
- Appium 1.17.1
- iOS 12.4
- simulators: iPhone 8 Plus, iPhone X
Link To Appium Logs
https://gist.github.com/nacfe/f85e049bbe608983313f85c01cbd2623
https://github.com/appium/appium/issues/13691