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

Java Robotium:如何等待加载完成后再继续?,java,android,junit,robotium,Java,Android,Junit,Robotium,我想为android应用程序编写一个Robotium/Junit测试。在某些步骤中,我希望我的测试等待直到旋转加载符号从屏幕上消失 我该怎么做呢?有不同的方法可以做到这一点。在Robotium中,有许多不同的waitFor方法可以使用。在您的情况下,您可以使用: solo.waitForDialogToClose() //waits for the dialog to close solo.waitForActivity() // if there is a activity change so

我想为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方法,请参阅

谢谢。。。它似乎可以工作,但使用此命令时所用的时间比我预期的要长:
solo.waitForActivity(solo.getCurrentActivity().toString())
@Renas如果我想等待水平进度条的意思,我该如何使用这些方法?solo.waitForDialogToClose()将不起作用,如果在progressdialog之后立即有警报对话框,robotium将等待警报对话框关闭。