React Native Automation

Could you please suggest me what could be the solution for this issue ?

  1. I bet in xCode is same. it is just problem how you write code. to fix in code - i have no solution. you need ask at react native forum.
  2. now let see what we have:
  • email input which we can found by class XCUIElementTypeTextField and id emailInput. use them BOTH to find input for email.
  • we have element with id submitEmail. use it to tap on “Submit” button

The ids are coming properly in Xcode but not in Appium, That is what we are not able to figure out.

Prove it with screenshot from xCode inspector

As per the screen shot emailInput is coming in Xcode inspector, But in Appium it is emailInput submitEmail. It should be unique id but it is getting all the testID’s of the page.

With xCode see class name not same. You pointing in xCode to last element (TypeTextField) which has same id in Appium inspector.

Hi @Aleksei could you pls add some more points to understand better,
the last comment i couldn’t under stand ,kindly do the needful

see in xCode inspector class ends with TextField which on Appium Inspector matching XCUIElementTypeTextField
image

Deep element structure is React Native code specific which makes harder find correct element plus it slows test execution.

We are able to find testid’s but we are not able to navigate child element in Appium. Please check the attached screenshot.

Ask developers to make element accessible. Same you will find with xCode inspector. Only app dev can fix this.

Do we need to set accessible={false} for all the parent components ?

I am not 100% sure. I do it very rare (thanks to our devs).
https://medium.com/short-swift-stories/accessibility-element-2d55cefdf9d7 ->

Good to remember:
 - elements relevant for users of the AUI should be marked as an accessibility element.
 - custom views that convey information or views that act as a container, used to group information, should be marked accessible.
 - don’t hide views if they convey information (disabled state).
 - low-sighted users can be confused if they can’t highlight what they can see on the screen.

Is there any forum for React Native Devs to follow for IOS ?

All the ones listed here. Maybe more?

Any dev docs related to Appium and React Native @wreed

And my exact problem is mentioned here

I’ve provided what I know. Unfortunately I’m not a developer, and the app I work on is not ReactNative.

@mohan_kumar Hey, facing same issue, did it get resolved ?