Android的 - 问题在控制使用Robotium内建的应用程序 [英] Android - issue in controlling builtin app using Robotium
问题描述
我写这些设备上测试自动化一个Android应用程序的测试。
I am writing an android testing application which automates testing on the device.
我瞄准的Facebook作为我的基本应用程序,并使用Robotium框架,以达到我的要求写一个应用程序。
I am targeting facebook as my base application and writing an app using the Robotium framework in order to accomplish my requirement.
到现在为止我已经成功地实施了一些功能,但我被困在一个点上:我要自动运行的上传图片的功能,但只要上传按钮后,该设备内置的应用程序被激活。使用Robotium我无法控制的默认应用程序。
Until now i have successfully implemented a few features, but I am stuck at one point: I want to automate the "upload picture" functionality, but as soon as the upload button is clicked, the device builtin application gets activated. I could not control the default app using Robotium.
有没有办法通过使用robotium写一些code或操作系统和Robotium可生成密钥斯托克斯之间写层解决这个问题,?
Is there any way to solve this, by writing some code using robotium or writing a layer between the OS and Robotium which can generate key stokes?
推荐答案
您说
OS和Robotium之间的一层。
a layer between the OS and Robotium.
如果你确定这一说法,有暗箱的 UIAutomator -framework由谷歌,这可能是能够做到这一点。
此外,
If you were ok with that, there is the black-box UIAutomator-Framework by google, which might be able to do that. Additionally,
您可能需要使用 monkeyrunner 是这样的:
You might want to use monkeyrunner like this:
$ monkeyrunner
>>> from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
>>> device = MonkeyRunner.waitForConnection()
>>> device.touch(200, 400, MonkeyDevice.DOWN_AND_UP)
您也可以做一拖,开始activies等看一看的API
MonkeyDevice 。
You can also do a drag, start activies etc. Have a look at the api for MonkeyDevice.
(从该SO回答)。
这篇关于Android的 - 问题在控制使用Robotium内建的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!