【发布时间】:2015-09-01 07:01:52
【问题描述】:
我正在执行以下测试以验证屏幕上的文本,文本显示在视图上但需要滚动页面才能手动查看文本。
onView(withText("Launch")).check(ViewAssertions.matches(isDisplayed()));
onView(withText("January 2010")).check(ViewAssertions.matches(isDisplayed()));
以下错误即将到来,但是文本存在于视图中,但需要手动滚动页面才能看到文本。
android.support.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'is display on the screen to the user' 与所选视图不匹配。 预期:在屏幕上显示给用户 得到:“TextView{id=2131361941, res-name=project_details_label_tv, visibility=VISIBLE, width=249, height=41, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable =false, 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=4.0, y=24.0, text=Status, input-type=0, ime-target=false, has-links=false}"
【问题讨论】:
-
我在这里回答了一个问题 - stackoverflow.com/questions/28218155/… ...
标签: java android ui-automation android-espresso