Android - 使用 Robotium 控制内置应用程序时出现问题
我正在编写一个 Android 测试应用程序,它可以在设备上自动进行测试。
我将 facebook 作为我的基础应用程序,并使用 Robotium 框架编写一个应用程序来完成我的要求。
到目前为止,我已经成功实现了一些功能,但我陷入了困境:我想自动化“上传图片”功能,但一旦单击上传按钮,设备内置应用程序就会被激活。我无法使用 Robotium 控制默认应用程序。
有没有办法解决这个问题,通过使用 Robotium 编写一些代码或在操作系统和 Robotium 之间编写一个可以生成按键的层?
I am writing an android testing application which automates testing on the device.
I am targeting facebook as my base application and writing an app using the Robotium framework in order to accomplish my requirement.
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.
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为你做不到。但是,您也许可以制作自己的内置应用程序的修改版本并使用它(如果您可以将其设为默认值,这样就不必通过选择屏幕),或者 root 手机并破坏其安全模型用作自动化测试设备。
I don't think you can do that. However you might be able to make your own modified version of the built-in application and use that instead (if you can make it default and so not have to go through a selection screen), or root a phone and break its security model to use as an automated testing device.
你说
如果你同意的话,有黑盒 UIAutomator -谷歌的框架,也许可以做到这一点。
此外,
(来自这个答案)。
You said
If you were ok with that, there is the black-box UIAutomator-Framework by google, which might be able to do that.
Additionally,
(from this SO answer).