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

Hi,

I’m using Appium 1.7.2 and automating a native application which is written in React. Not sure if anybody else is facing this issue but when I’m trying to get a text of an element in ios application, the text value is the same as accessibility label, value, name and not giving me the actual text that is visible on the application.

We are using accessibilityLabel’s to identify elements and we can reach the elements. The problem is last week we suddenly couldn’t get the text of the elements in ios application. On Android same elements can give the correct text but on ios it is as I said.

We’ve already tried the followings;

  • Roll back to previous version of react native
  • Using a testId to accessibilityLabel converter plugin
  • Getting every type of attribute, name, text…

Thanks in advance

How are you trying to get the text of the element. Please share the code statement

driver.findElementByAccessibilityId(accessibilityId).getText(); / also tried with getAttribute(“value/text/name/accessibilityLabel”)

driver.findElement(By.xpath("//XCUIElementTypeOther[@name="" + elementName + “”]"));

I can find the element but when I’m trying to get the text its the same as the accessibilityId, and in the both appium and xcode inspector it also shows all of the values are the same.

Screenshot of the inspector please.

For example this element with ADULT text.

Thanks. Did you try to use the same Appium server version that you have been using before and see if problem persists. or use the latest latest version of Appium server

I’ve tried with the latest Appium version also and it was a failure also.

Try switching to webview and try to fetch the text. It could be react native rendering issue

I have the same on Appium 1.8.1, iOS 11.4, RN 0.56.0.

Have you had any luck solving this?

edit: for me the solution was to use for android accessible: true, accessibilityLabel: 'the-id' and for iOS: testID: 'the-id'

(taken from: https://github.com/tipsi/react-native-testid)

I have the same issue, for react native app i can’t able to find the elements.

2 Likes

Is there any update on this issue?

Is there any update on this issue? I am facing same issue for ionic application.

Is there any way to solve this problem? Or this is a non resolved issue yet? :frowning:

2 Likes

Hi …

Is anyone got Solution for this question.I am also having the same issue. [React Native App on ios, element has the same value for name, values, text, accessibilityLabel etc].So not able to get text from element. Any one have solution/workaround?

Yo got any solution/workaround for this issue ?

The issue arises in Appium when the navigation tree reaches 5 nested navigators on iOS. Instead of being able to access the content of the current page, it returns a single XCUIElementTypeOther element. This problem is an open issue in Appium.


Simply including “appium:settings[snapshotMaxDepth]”: 70 in the JSON settings before initiating the session solved my problem.