Appium 2 accessibility ids not found

Hello,

i upgraded from appium 1.22.3 to Appium 2.x and now i have the problem that i cant find accessibility ids in my native app. If i log driver.getSource() i only get the name of the elements, before the Appium Upgrade i used the ids for every element.

I use the IOSDriver, the strange thing is that when i inspect the elements with AppiumInspector there are the accessibility ids available.
Has anyone else the same problem?

My Capabilities:
“appium:platformName”: “iOS”
“appium:platformVersion”:“16.0”
“appium:deviceName”:“iPhone 13”
“appium:automationName”:“XCUITest”
“appium:app”:"/Users/home/myapp.zip"

Name value is actually id

ok, in my case it is an input element, when i click it by name, the keyboard is not opened

is it possible to use the same xcuitest driver version which is used in appium 1.22.3?

Better add page source of problematic screen and your code.

Thats the page source:

And my code:

((IOSDriver) driver).findElementByName("[email protected]").click();
((IOSDriver) driver).findElementByName("[email protected]").sendKeys(“test”);

pagesource.txt (6.1 KB)

You have two input elements on screen for username and passcode.
Better use search by element classname XCUIElementTypeTextField which return list.
Use first element in list for email and second for passcode.

I tried that, but when i want to click for example the first one, the keyboard is not opened and sendKeys is not working

Before updating to Appium 2, which driver was used for testing an native app? The Capability automationName was not set.

There is something wrong. You may tap by coordinates for sure that should 100% work.
Possibly there is some race condition e.g. you tap while screen appears (in such case tap will not work).

To check the idea add a bit wait for sure. Log element center coordinates. Tap on them. Check that coordinates are correct.

Also try tap logic instead of click.

Thanks for your tip.
When i tap the element by the coordinates it works.

When i make tap by element it also did not work, only tap by Coordinates works. Strange, or?

Strange things happen sometimes. Also depends on tap zone specified with element.

Yes you are right :slight_smile: This is the only screen in my app where the click() is not working, in all the other screens in works fine.

Thank you very much for your help.