Espresso无法单击显示的视图

问题描述 投票:0回答:1

整夜我的用户界面测试突然停止工作:

咖啡师clickOn(R.id.myView)中的行抛出:

com.schibsted.spain.barista.internal.failurehandler.BaristaException: Could not perform action single click on view with id: [...]   
[...]   
Caused by: androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: (is displayed on the screen to the user and with id: [...]

Espresso onView(withId(R.id.myView)).perform(scrollTo(), click())中的行引发:

androidx.test.espresso.PerformException: Error performing 'single click - At Coordinates: 53, 1723 and precision: 16, 16' on view 'Animations or transitions are enabled on the target device.  
[...]   
Caused by: java.util.NoSuchElementException: List is empty.

我不明白为什么会这样。在测试过程中,我可以在屏幕上看到视图,而意式浓缩咖啡为我提供了一些坐标。

编辑:由于它是TextView,所以我也尝试了Baristas clickOn(context.getString(R.string.myText)),但它抛出:

com.schibsted.spain.barista.internal.failurehandler.BaristaException: Could not perform action single click on view with text: is [...]  
[...]   
Caused by: androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: (is displayed on the screen to the user and with text: is [...]
<TextView
   android:id="@+id/myView"
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:text="@string/myText"/>
android android-espresso android-testing barista
1个回答
0
投票

该错误与Espresso或Barista无关。java.util.NoSuchElementException: List is empty被引发到视图的OnClickListener中。

© www.soinside.com 2019 - 2024. All rights reserved.