1

I'm attempting to do: call on a textview activity.

My issue is I can't get textview work using espresso.

My Java class

onView(withText("Latter Glory Ministries")).check(matches(isDisplayed()));

Throws this exception:

android.support.test.espresso.AmbiguousViewMatcherException: '(with text: is "Latter Glory Ministries" and view has effective visibility=VISIBLE)' matches multiple views in the hierarchy.

Problem views are marked with '****MATCHES****' below.

Gradle

androidTestCompile 'com.android.support.test.espresso:espresso-core:2.0'
androidTestCompile 'com.android.support.test:testing-support-lib:0.1'

Thanks for your ideas!

Reaz Murshed
  • 23,691
  • 13
  • 78
  • 98
  • Please add your UI – Reaz Murshed Aug 26 '16 at 19:25
  • @ReazMurshed do you mean the xml ?is just a textview which has text="xx" if u need the test class ..i added it onView(withText("Latter Glory Ministries")).check(matches(isDisplayed())); – Kevin Janvier Aug 26 '16 at 19:48
  • Possible duplicate of [in Espresso, how to choose one the view who have same id to avoid AmbiguousViewMatcherException](http://stackoverflow.com/questions/29378552/in-espresso-how-to-choose-one-the-view-who-have-same-id-to-avoid-ambiguousviewm) – piotrek1543 Aug 26 '16 at 21:58
  • you have more than one `TextView` with this `String` value. Check your layout if fragment/view is not added twice or moer – piotrek1543 Aug 26 '16 at 22:00

0 Answers0