Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/203.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android,Espresso:未找到带有“end by”标记的ImageView;";_Android_Android Espresso - Fatal编程技术网

Android,Espresso:未找到带有“end by”标记的ImageView;";

Android,Espresso:未找到带有“end by”标记的ImageView;";,android,android-espresso,Android,Android Espresso,我想找到带有以文本“en”结尾的标记的imageView 我的浓缩咖啡测试: @Test public void testViewPagerSwipe() { onView(withId(R.id.containerLanguageEN)).perform(click()); onView(withId(R.id.textViewNext)).perform(click()); ImageView imageViewTour = (ImageView) mActi

我想找到带有以文本“en”结尾的标记的imageView

我的浓缩咖啡测试:

    @Test
public void testViewPagerSwipe() {
    onView(withId(R.id.containerLanguageEN)).perform(click());
    onView(withId(R.id.textViewNext)).perform(click());
    ImageView imageViewTour = (ImageView) mActivityRule.getActivity().findViewById(R.id.imageViewTour);
    String tag = (String) imageViewTour.getTag();
    if (BuildConfig.DEBUG)
        Log.d(TAG, "testViewPagerSwipe: tag = " + tag);
    onView(allOf(withId(R.id.imageViewTour), withTagValue(is((Object) endsWith("en"))))).check(matches(isDisplayed()));
}
此测试打印:

testViewPagerSwipe: tag = walkthrough_01_en
正如您所看到的,imageViewTour的标记是“漫游”

但测试是失败的:

     android.support.test.espresso.NoMatchingViewException:

No views in hierarchy found matching: (with id: com.myproject.android.dev:id/imageViewTour and with tag value: is <a string ending with "en">)
android.support.test.espresso.nomatchingvieweexception:
在层次结构中找不到匹配的视图:(id:com.myproject.android.dev:id/imageViewTour,标记值:is)
为什么?