Appium robotium 的讨论帖

思寒_seveniruby · 2013年10月26日 · 最后由 恒温 回复于 2013年10月28日 · 1542 次阅读

对 robotium 不了解,所以发起一个讨论帖,看看其他人了解不。
目前不少公司,比如网易,使用的是这个工具。

阅读了 robotium,初步感觉是使用插桩体系来进行自动化。毕竟目前低版本的 android 只有这一条方式了。
如果是只有 apk 的情况下。官方有如下说明

With Robotium it is possible to run test cases on applications where you only have the apk file.

For step by step instructions with images download this tutorial.

Introduction
The .apk file has to have the same signature as your test project. If you do not have the signature key of the .apk file then you need to remove the signature and resign it with you own key, android debug key can be used. A drag and drop java tool can be downloaded from here which strips the apk file from its signature and then signs it with your android debug key. If the new apk is not saved then try to run the re-sign tool as an administrator. In windows that would be done by right clicking the re-sign.jar and select run as administrator. In OS X it can be done by opening up the terminal and then "sudo java -jar re-sign.jar".

The android debug key is used by Eclipse when signing applications and test projects before installing them on the emulator/device. Many times it is easier to just use that key when resigning the apk.

也就是说,如果是针对手机 qq 这种,对自身签名有判断的应用,其实是不行的。

所以 appium 在这点上,具有很好的优势。appium 是可以跨 app 的,而且可以自动化系统的 ui 功能

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 4 条回复 时间 点赞

appium 很不错的一个框架,非常看好,而且 selenium3.0 今年圣诞貌似要启动了,会把移动端的功能也整合进去,将来能够统一 Web、移动端的编写用例方法,不过现在感觉还是有些不稳定。
android 上的跨应用因为底层使用了 uiautomator,只支持 4.1 以及以上版本才可以跨应用吧,uiautomator 对于一些手势操作支持的怎么样没尝试过不知道。
Robotium 的话对于手势的支持还是不错的,需要重签名这个问题,只需要保证被测 app 和测试 app 签名一样就可以,如果针对手机 qq 有签名判断的,需要测试 app 也使用一样的签名才行,没有签名判断的应用,直接使用 debug key 签名一下即可。不过 Robotium 这种工具写用例的话存在的一个用例就是调试的时候很费时间,需要先把测试 app 安装到机器,然后运行起来,一下子几分钟时间就浪费了。

#1 楼 @kevinkong appium 是在低版本上使用 selendroid,高版本上使用 uiautomator。所以也是支持全系列的 android。鼠标手势也是全支持的。
Robotium 和 Appium 在低版本的 android 上,使用的应该都是相同的技术体系,基于 android 的插桩方式。

通过设置相同签名这个方法不错。

Robotium 可用来进行 App 的 Ui Test,目前版本 4.3。支持一系列的点击、滑动、长按等事件。测试类需基础 ActivityInstrumentationTestCase2,沿用的 Junit 的测试思路。测试 APP 和被测 APP 运行在同一个进程之中,由 Instrument 来驱动。Robotium 是 Android 测试上较早的自动化框架,11 年 4 月发布的第一个版本,至今已经有相当丰富和完善的库。http://www.robotium.cn/ 该网站拥有较为丰富的学习资料和中文文档。感谢 LZ 邀请,如使用 robotium 过程有疑问,可通过站方与我联系交流。

#3 楼 @lizhenghuan xili 哇,加个头像呗。

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册