Appium 1.3.1 MobileBy.AccessibilityId or By.name does not work always

When we upgraded to Appium 1.3.1/iOS8, we had to change few MobileBy.AccessibilityId to By.xpath to make it work.
Is any one having same problem ?

with Appium 1.3.1/iOS7tests were running fine with MobileBy.AccessibilityId.

1 Like

It’s possible that iOS 8 is returning multiple matches for the accessibility label. I noticed this sort of thing when we first upgraded to 7.1

You can find out for sure by printing out how many elements are returned by findElements (java example):
driver.findElements(MobileBy.AccessibilityId(“accessibilityID”)).size();

If there is a page object you can use it since java-client 2.1.0:

@iOSFindAll({
@iOSFindBy(accessibility = “accessibility1”),
@iOSFindBy(accessibility = "accessibility2)
})
MobileElement mobileElementWithDifferentAccessibilityOnDifferentIOS;

It was designed for the cases like yours and should provide the test running on different platform versions.
The similar annotation @AndroidFindAll was designed for Android. Both are supported by Appium.