Cannot identify the 4th or later child of ScrollView on React Native and iOS

I’m facing the issue that I cannot detect the 4th or later child view of the React Native <ScrollView> component. It happens only on iOS and I have no issue on Android.

For example, I can detect view 1, view 2 and view 3 but cannot for view 4.

<ScrollView>
  <View testID='view 1'>  //OK
    <View testID='view 2'>  //OK
      <View testID='view 3'>  //OK
        <View testID='view 4'></View>  //NG
      </View>
    </View>
  </View>
</ScrollView>
  • Platform you are automating (iOS or Android): iOS (React Native)
  • Appium version: v1.19.0
  • Simulator/Emulator or Real Device: Simulator
  • The language you are using for writing tests (client binding): Python
  • Your OS: macOS 10.15.7

Thank you for the reply @mykola-mokhnach
I looked through the github issue, but I don’t get what the solution is.
Do you advise increasing snapshotMaxDepth? or there’s nothing we can on Appium side?

You could try to play with that setting, but it looks like the original issue still lies on the XCTest side: testmanagerd simply crashes if there are too many nested nodes.
Try switching to hybrid mode instead.

What do you exactly mean “switching to hybrid mode”?

http://appium.io/docs/en/writing-running-appium/web/hybrid/

@mykola-mokhnach Correct me if I’m wrong. Is this document for testing WebView? If so, I’m not using WebView and it’s not applicable for me?

All react apps are internally web views. It is just necessary to enable debugging on them to be able to switch the context

The issue has been resolved by updating snapshotMaxDepth right before finding an element.

self.driver.update_settings({"snapshotMaxDepth": 100})

Thank you for your support @mykola-mokhnach!

1 Like

hi, can you tell me how I make this configuration to use in codeceptjs mobile?