gpt4 book ai didi

android - 执行异常 : Error performing 'single click'

转载 作者:IT王子 更新时间:2023-10-28 23:57:45 25 4
gpt4 key购买 nike

我在运行 android espresso 测试时遇到错误:

com.google.android.apps.common.testing.ui.espresso.PerformException: Error performing 'single click' on view 'with id: is <2131034173>'.

我的代码很简单:

onView(withId(R.id.btn)).perform(click());

但是这段代码没有错误:

onView(withId(R.id.btn)).check(matches(isDisplayed()));

我找不到它发生的原因。

最佳答案

诀窍是读取错误的完整堆栈跟踪。在中间,有一些关键的信息是这样的:

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.
Target view: "ImageView{id=2131492903, res-name=button_hamburger, desc=opens the side drawer, visibility=VISIBLE, width=64, height=64, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=6.0, y=6.0}"

详细解释了错误。

关于android - 执行异常 : Error performing 'single click' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29786413/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com