Robotium:如何等待加载完成后再继续?

发布于 2025-01-08 14:33:43 字数 94 浏览 5 评论 0原文

我想为 Android 应用程序编写 Robotium/Junit 测试。在某些步骤中,我希望我的测试等到旋转的加载符号从屏幕上消失。

我怎样才能做到这一点?

I want to write a Robotium/Junit test for an android app. At certain steps, I want my test to wait until the spinning loading symbol disappears off the screen.

How can I do that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我做我的改变 2025-01-15 14:33:43

您可以通过不同的方式来做到这一点。在 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 API 文档了解更多 waitFor 方法在机器人中。

There are different ways in which you can do that. In Robotium there are a lot of different waitFor methods that you can use. In your case you can use:

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.

Please see the Robotium API Documentation for more waitFor methods in Robotium.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文