How do I get the accessibility value of a React Native view in an Android app?

Viewed 788

I'm writing automated tests for an Android app that uses React Native to render most UI elements. As React Native views don't support resource IDs like Android views do, I've been using accessibility labels for automation purposes.

However, I also need to access the accessibility values of some views. For example, some of our code looks like this:

<View accessibilityLabel = "some_label" accessibilityValue = "some_value" />

I can get the accessibility label using withContentDescription() in Espresso and getContentDescription() with standard Android code. However, it's not clear how to do the same for accessibility values.

Thanks in advance!

0 Answers
Related