Hybrid App on ios, element has the same value for name, values, text, accessibilityLabel etc


I’m using Appium 1.7.0 to automating a Hybrid application developed in Ionic framework. when I’m trying to get an id of an element for iOS application, the text value is the same as accessibility label, value, name and not giving me the actual id that is visible on the application while inspecting.

On Android same elements can give the correct value of id but on iOS it is as I said.

That sounds like an issue I’ve seen when setting the accessbilityLabel property for both iOS & Android in our React Native app. The issue for us was that we needed to use the testID property on iOS and accessibilityLabel for Android, separately, so we created a javascript function that applies the appropriate label for the platform during the build.


const IS_ANDROID = Platform.OS === ‘android’;

export const testId = id => (
IS_ANDROID ? { accessible: true, accessibilityLabel: id } : { testID: id }

Usage Example

<TextField {…testId(‘TextFieldTestID’)} />

Sorry, but our question is why we get same values for “accessibility label, value, name” when we inspect using Appium inspector whereas when we inspect using safari then we got real id & name that are defined by Developer.
So is there any step we are missing while setting up appium.