3

I am using React Native picker (@react-native-community/picker) to create picker fields in react native. Now after building the APK, I ran the app in Appium. My aim is to using Appium to select the picker items. For that I need accessibilityId. So, I passed accessibilityLabel in Picker and Picker.Item.

But when I am inspecting the items I can't find any accessibilityId.

enter image description here

I want to perform the click operations and create test script, and I don't want to use the XPath. That's why I want accessibilityId. Is there any way to make accessibilityId available to Picker Items? Or is there any way to select these items and do click operations?

Shubham Navale
  • 220
  • 2
  • 13

1 Answers1

0

In your react code try to add accessibilityLabel in some kind of tag that generates native "View" tag in android. You can try wrap this picker element in <TouchableOpacity> and then add the label.

<TouchableOpacity accessibilityLabel="picker-mr">
VivaceNonTroppo
  • 456
  • 1
  • 3
  • 13