其他分享
首页 > 其他分享> > android – MonkeyRunner:更可靠的等待和全长截图?

android – MonkeyRunner:更可靠的等待和全长截图?

作者:互联网

我一直在和monkeyrunner一起讨厌 – 抱歉不得不试着告诉那个笑话.

我想要实现三件事:

1)仅在我的应用程序完全启动和加载时发送键命中.如何在不依赖不可靠的MonkeyRunner.sleep(3)的情况下做到这一点?

2)如果可能的话,我如何捕获我的应用程序的整个长度(可滚动)的屏幕截图?

3)是否可以通过monkeyrunner将参数传递给我的应用程序,以便这些参数可以在应用程序中使用?

谢谢大家的帮助

解决方法:

1) Only send key hits when my app has
fully launched and loaded. How can I
do this without relying on the
unreliable MonkeyRunner.sleep(3)?

您需要使用python的子进程模块和adb的logcat来监视日志并查看应用程序何时打开.

2) How can I capture screenshots for
the full length of my application (its
scrollable), if at all possible?

如果您在真实设备上运行它,那么它是不可能的.如果您正在使用模拟器进行操作,那么只需将其设置为模拟器屏幕就像您需要屏幕截图一样大.

3) Is it possible to pass parameters
to my application via the monkeyrunner
so that these parameters can be used
within the application?

是的,请参阅您拥有的选项here.

标签:android,monkeyrunner
来源: https://codeday.me/bug/20190531/1187519.html