加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java – Robotium:如何在继续之前等待加载完成?

发布时间:2020-12-14 16:31:34 所属栏目:Java 来源:网络整理
导读:我想为 Android应用程序编写Robotium / Junit测试.在某些步骤中,我希望我的测试等到旋转加载符号从屏幕上消失. 我怎样才能做到这一点? 解决方法 有不同的方法可以做到这一点.在Robotium中,您可以使用许多不同的waitFor方法.在您的情况下,您可以使用: solo.
我想为 Android应用程序编写Robotium / Junit测试.在某些步骤中,我希望我的测试等到旋转加载符号从屏幕上消失.

我怎样才能做到这一点?

解决方法

有不同的方法可以做到这一点.在Robotium中,您可以使用许多不同的waitFor方法.在您的情况下,您可以使用:
solo.waitForDialogToClose() //waits for the dialog to close
solo.waitForActivity() // if there is a activity change
solo.waitForText() //if a certain text appears after the loading is done
solo.waitForView() //if a certain view is shown after the load screen is done.

有关Robotium中的更多waitFor方法,请参阅Robotium API Documentation.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读