I'm trying to conduct Black Box testing on a 3rd party apk file using Android Espresso. I don't have access to the source code of the 3rd party apk file.
So, I'm able to get the UI element ids using UIAutomatorViewer
. However, in the Espresso file, I don't have access to "R".
So when I'm calling onView(withId(R.id.<ui id>))
, it's returning an error:
package R does not exist
Example:
onView(withId(R.id.fragment_onboarding_skip_button)).perform(click());
It can be solved by creating a method extracting an integer ID from the ID name: