使用Robotium的功能测试问题
我们在测试 Android 应用程序时遇到问题。我们的架构如下:设备上安装了两个 apk 文件,第一个 apk 文件提供了打开特定应用程序的链接,第二个 apk 文件实际运行该应用程序。现在有两个实际运行应用程序的进程。我们可以使用 Robotium 调用第一个进程 (apk),然后 Robotium 单击特定链接来打开特定应用程序,但应用程序启动时我们无法单击任何位置。该应用程序由第二个进程(apk)运行。我们得出的结论是,Robotium 无法从第二个流程获取活动,因为它坚持一个流程,即所谓的检测。
现在你有什么推荐?
有没有其他工具或方法可以解决这个问题?
谢谢。
We have got a problem while testing Android apps. Our architecture is as follows: there are two apk files installed on device, first apk file gives link to open specific app and second apk actually runs that app. Now there are two processes which actually runs app. We are able to invoke first process (apk) using Robotium, then Robotium clicks on specific link to open specific app but we are unable to click anywhere when app is launched. The app is run by second process (apk). We are at conclusion that Robotium will not work to get activities from second process because it sticks to one process and that is called instrumentation.
Now what do you recommend?
Is there any other tool or approach to overcome this issue?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据我的研究,我还没有找到解决这个问题的简单方法。我实施了一种解决方法,似乎可以为我们的产品提供我们需要的覆盖范围。
1) 使用 Robotium 套件测试第一个 apk。
2) 当您启动第二个 apk 时,有一个单独的 Robotium 套件可以对其进行测试。
现在,在这两件事之间,有一些事情你必须假设。您必须假设第二个 apk 已正确启动,才能通过这些 Robotium 测试。
例如:
Robotium 测试第一个 apk 启动器活动。从这个 apk 中,您仍然可以测试第二个 apk 是否启动。然后在那里停止 Robotium 测试套件。
现在,您的第二个 Robotium 测试套件应该调用第二个 apk 的启动器活动。
您可以在 bash 文件或其他脚本中编写此脚本。
From my research I havent found an easy way around this. I implemented a workaround that seems to give our products the coverage we need though.
1) Have a Robotium suite test the first apk.
2) When you launch the second apk, have a separate Robotium suite that can test that.
Now between these two things there is something you have to assume. You have to assume the fact that the second apk was launched correctly for those Robotium tests to pass.
For example:
Robotium tests the first apk launcher activity. From this apk you can still test that the second apk launches. Then stop that Robotium test suite there.
Now your second Robotium test suite should invoke launcher activity for the second apk.
You can script this out in a bash file, or some other script.