我如何编写使用内置的摄像头进行拍照独奏/ Robotium测试用例? [英] How do I write a Solo/Robotium testcase that uses the builtin camera to take a picture?

查看:109
本文介绍了我如何编写使用内置的摄像头进行拍照独奏/ Robotium测试用例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从我的活动我做startActivityForResult(MediaStore.ACTION_IM​​AGE_CAPTURE),结果
然后我土地的内置摄像头的活动(在这种情况下,在模拟器)。

From my activity I do startActivityForResult(MediaStore.ACTION_IMAGE_CAPTURE),
and then I land in the builtin camera activity (in this case in the emulator).

当我现在要做的:结果
solo.clickOnButton(0);搜索
在我的测试用例,它没有找到任何按钮(null被发现指数= 0)。

When I now do:
"solo.clickOnButton(0);"
in my testcase, it does not find ANY button (null is found for index=0).

我如何编写使用内置的摄像头进行拍照独奏/ Robotium测试用例?

How do I write a Solo/Robotium testcase that uses the builtin camera to take a picture ?

推荐答案

根据Robotium文档,你不能这样做,因为这跨越两个应用程序(你一个和默认的摄像头活动)。请参见 HTTP://$c$c.google.com/p/robotium/维基/ QuestionsAndAnswers

according to the Robotium doc you cannot do this as this spans two applications ( your one and the default camera activity ). See http://code.google.com/p/robotium/wiki/QuestionsAndAnswers

您要么需要你的包内编写自己的相机实现或写两个测试应用程序

You will either need to write your own camera implementation within your package or write two test applications

希望这有助于:)

这篇关于我如何编写使用内置的摄像头进行拍照独奏/ Robotium测试用例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆