Android 浓缩咖啡测试不能处理采摘者

Android 浓缩咖啡测试不能处理采摘者,android,android-espresso,android-studio-2.3,Android,Android Espresso,Android Studio 2.3,测试中有一个下拉列表。录音机捕捉到打开选项下拉列表的点击。但是单击选择一个失败,出现以下错误: Caused by: java.lang.RuntimeException: Action will not be performed because the target view does not match one or more of the following constraints: at least 90 percent of the view's area is displayed t

测试中有一个下拉列表。录音机捕捉到打开选项下拉列表的点击。但是单击选择一个失败,出现以下错误:

Caused by: java.lang.RuntimeException: Action will not be performed because the target view does not match one or more of the following constraints:
at least 90 percent of the view's area is displayed to the user.

此问题涉及约束,但其建议仅使用isCompletelyDisplayed不起作用。

是的,当您正在单击的视图处于滚动位置时,会发生这种情况,用户无法看到它

只需使用:

onView(withId(whatever)).perform(scrollTo(), click())

我假设您的视图可以使用onview选择器作为目标。

澄清一下:使用picker或dropdown,您指的是微调器?微调器元素的外观如何?有多少可供选择?这是一个简单的下拉菜单,而不是选择器。是的,只是一个旋转器。我的第一个错误是认为录音机是一种观察浓缩咖啡是如何运转的方式。现在正在取得一些进展。你的答案并没有解决这个问题,因为这个微调器所有的选择都显示在点击上,但我想知道如何做这件事太准确了,所以+1。谢谢。但我的意思是,单击打开微调器的按钮,然后在微调器上瞄准视图,执行滚动并单击它,我知道你的意思。我要说的是,当点击注册时,值就会出现,不需要滚动。90%的事情是在微调器本身的点击下发生的。如果微调器点击触发了90%的错误,那么也可以使用scrollTo对该点击进行操作。我将重新讨论该问题。我终于得到了一个相对干净的测试工作,这是很好的。当然,放弃录音机把我带到那里的所有希望。现在,我只需要定义一个内联ViewAction。