Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to read react native texts #2537

Closed
gustavo-aily opened this issue Mar 17, 2025 · 2 comments
Closed

Not able to read react native texts #2537

gustavo-aily opened this issue Mar 17, 2025 · 2 comments

Comments

@gustavo-aily
Copy link

gustavo-aily commented Mar 17, 2025

Hello!


I'm opening this issue on the xcuitest driver project, since is working on the Android project with the same react-native application code.
If is not related to this, let me know


I'm facing an issue with a React Native application I'm testing. The application is made in react native and, in general is OK and accessible to Appium.

However, there are some elements in the code, for example react native's that I'm not able to make it work in the tests.

A bit of context:

  • An element inside a list that contains a <View>. Inside that <View> there's a view and a button and inside the 2nd view, 2 <Text> elements.
  • The <Text> elements both have the testID property set from react native's code

With appium inspector I see the item element as 2 separate elements. One is the button and One is the texts one unique XCUIElementTypeOther (is only seen as one). When I read the XCUIElementTypeOther element, it groups both contained texts. So, if the first contains the text "Card Title 1" and the seconds <Text> contains "Card Sub Title 1", appium sees it as "Card Title 1 Card Sub Title 1 " (including that weird character at the end)

Things to notice:

  • No id was displayed

If I add to one of elements the "accessibilityLabel", appium sees everything the same, except the testid is added to the element text as such "Card Title 1 test-id-edit-priorities-card-ios-sub-title "

So, my question is. Have anyone faced this issue and know how to solve it?

React native "react-native": "0.76.7",
Appium 2.13.1
Driver [email protected]

Capabilities I'm using

{
  "appium:automationName": "XCUITest",
  "platformName": "iOS",
  "appium:app": "my_app_here",
  "appium:settings[snapshotMaxDepth]": "65",
  "appium:noReset": true,
  "appium:autoAcceptAlerts": false,
  "appium:settings[boundElementsByIndex]": "true",
  "appium:platformVersion": "17.5",
  "appium:deviceName": "iPhone 15",
  "appium:showXcodeLog": true
}

Note on this one, we've tried even setting it to higher numbers and didn't worked
"appium:settings[snapshotMaxDepth]": "65"

@KazuCocoa
Copy link
Member

Asking questions in https://discuss.appium.io/ would help rather than here

@gustavo-aily
Copy link
Author

I'll close it, since I opened the discussion in the discuss.appium page. Thanks @KazuCocoa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants