If I have an "AppCompatTextView" element that I can access by:
onView(withId(R.id.allergies_text))
From Layout Inspector:
Is there a way I can access the text of the element in Android Studio? (to access whatever text is there... not check if some text exists in the element)
I tried to do:
val tv = onView(withId(R.id.medical_summary_text_view)) as TextView
val text = text.text.toString()
print(text)
But I get the error:
android.support.test.espresso.ViewInteraction cannot be cast to android.widget.TextView
