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


#1

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


#2

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


#3

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.


#4

Screenshot of the inspector please.


#5

For example this element with ADULT text.


#6

#7

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


#8

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


#9

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


#10

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)


#11

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