User scenario testing for Android(功能性测试框架)

Robotium is an Android test automation framework that has full support for native and hybrid applications. Robotium makes it easy to write powerful and robust automatic black-box UI tests for Android applications. With the support of Robotium, test case developers can write function, system and user acceptance test scenarios, spanning multiple Android activities.

See Questions & Answers for common Robotium questions and answers.

See Getting Started for instructions and examples on how to create your first Robotium tests.

Join the discussions in the Robotium Developers Group.

robotium wiki:http://code.google.com/p/robotium/w/list

这里有篇文章对于robotium的介绍很贴切:robotium 是 android 自带类 Instrumentation 的一个封装,方便测试人员直接调用封装好的接口,也就是说,实际上我们直接使用Instrumentation 也能够进行自动化测试,但robotium可以简化我们的测试步骤,我们只需要调用某个robotium的API,传几个参数,就等于我们在调用一部分的Instrumentation帮我们实现测试。robotium 就是富二代!!高帅富!!

http://www.51testing.com/?uid-22381-action-viewspace-itemid-238847

需要注意:

1.测试项目:例如:HelloWorldTest,Build Path需要导入robotium-solo.jar包

2.Eclipse:3.7 版本,需要勾选Order and Export中的内容

    1. package com.luwenjie.helloworld.test;
    2. import android.test.ActivityInstrumentationTestCase2;
    3. import com.luwenjie.helloworld.HelloWorldActivity;
    4. import com.jayway.android.robotium.solo.Solo;
    5. public class HelloWorldTest extends ActivityInstrumentationTestCase2
    6. <HelloWorldActivity>{
    7. private Solo solo;
    8. //需要测试的app是什么?
    9. //这里需要测试com.luwenjie.helloworld包下的HelloWorldActivity这个应用
    10. public HelloWorldTest(){
    11. super("com.luwenjie.helloworld", HelloWorldActivity.class);
    12. }
    13. //打开HelloWorld这个应用
    14. public void setUp() throws Exception{
    15. solo = new Solo(getInstrumentation(), getActivity());
    16. }
    17. //执行测试
    18. //searchText(String str):验证字符串是否存在
    19. public void testUI() throws Exception {
    20. boolean expected = true;
    21. boolean actual = solo.searchText("Hello") && solo.searchText("World");
    22. assertEquals("This and/or is are not found", expected, actual);
    23. }
    24. }

Android 测试工具集02的更多相关文章

  1. Android 测试工具集01

    Appium是一个支持原生,混合和移动web apps的开源的跨平台测试框架工具. ANDROID依赖 Android SDK API >= 17 (Additional features re ...

  2. 自动渗透测试工具集APT2

    自动渗透测试工具集APT2   APT2是Kali Linux新增的一款自动渗透测试工具集.它可以进行NMAP扫描,也可以直接读取Nexpose.Nessus和NMAP的扫描结果,然后自动进行渗透测试 ...

  3. 2014 非常好用的开源 Android 测试工具

    http://www.php100.com/html/it/mobile/2014/1015/7495.html 当前有很大的趋势是转向移动应用平台,Android 是最广泛使用的移动操作系统,201 ...

  4. Slickflow.NET 开源工作流引擎高级开发(六) -- WebTest 引擎接口模拟测试工具集

    前言:引擎组件的接口测试不光是程序测试人员使用,而且也是产品负责人员需要用到的功能,因为在每一步流转过程中,就会完整模拟实际用户发生的场景,也就容易排查具体是程序问题还是业务问题,从而快速定位问题,及 ...

  5. 常见Android测试工具简介

    在进行android设备测试过程中,在进行系统测试时候,往往需要关注到很多方面,导致一个崩溃或者运行一段时间自动重启或者停止的问题很多.最简单来看,影响因素就有:底层硬件设备.OS层.上层app层.另 ...

  6. Android测试工具 UIAutomator介绍

    UI Automator 测试工具定义以及用途 UI Automator 测试框架提供了一组 API,用于构建在用户应用和系统应用上执行交互的界面测试.通过 UI Automator API,您可以执 ...

  7. 微软modern.IE网站,多版本IE免费测试工具集

    微软今天发布了modern.IE,这是一系列免费的.针对Web 开发者的测试工具和资源集合网站,微软希望以此来帮助开发者更轻松地实现跨 IE 和其他现代浏览器.跨设备的兼容性,其他还有代码检测工具.标 ...

  8. (转)【Android测试工具】03. ApkTool在Mac上的安装和使用(2.0版本)

    http://blog.csdn.net/wirelessqa/article/details/8997168 http://code.google.com/p/android-apktool/dow ...

  9. monkey测试===Android测试工具Monkey用法简介(转载)

    Monkey是Android中的一个命令行工具,可以运行在模拟器里或实际设备中.它向系统发送伪随机的用户事件流(如按键输入.触摸屏输入.手势输入等),实现对正在开发的应用程序进行压力测试.Monkey ...

随机推荐

  1. Haproxy+PXC实现负载均衡

    软件负载均衡一般通过两种方式来实现:基于操作系统的软负载实现和基于第 三方应用的软负载实现.LVS就是基于Linux操作系统实现的一种软负载,HAProxy就是开源的并且基于第三应用实现的软负载.HA ...

  2. JAVA中List与Array之间互换

    1.Array转List ArrayList<String> list = new ArrayList<String>(); String[] arr = new String ...

  3. AngularJS 之Services讲解

    Angular带来了很多类型的services.每个都会它自己不同的使用场景.我们将在本节来阐述. 首先我们必须记在心里的是所有的services都是singleton(单例)的,这也是我们所希望得到 ...

  4. static_cast与dynamic_cast转换 最简单的理解

    3.1 static_cast用法:static_cast < type-id > ( exdivssion ) 该运算符把exdivssion转换为type-id类型,但没有运行时类型检 ...

  5. VB.NET生成Excel,已存在提示框点否时报错

    如题 Exception from HRESULT: 0x800A03EC 最终没有好的解决方案,只好屏蔽掉 Try obook.SaveAs(excelSaveName) Catch ex As S ...

  6. SQL Server 对dbcc checkdb的优化

    方法 1. 在运行dbcc checkdb前对数据库进行快照(事务是一致的),dbcc 对快照进行检测,dbcc完成后删除快照. 做快照的目的是为了不要让dbcc 申请太多的锁,从这里可以看出dbcc ...

  7. DataSet 中的数据排序 及 DataRow装成DataTable

    1.DataSet 中的数据排序 DataSet ds = new DataSet(); // 获取当前排口的数据 ds = _xiaobill.GetHistoryData(yinZiBianm, ...

  8. HeadFirst设计模式读书笔记(2)-观察者模式(Observer Pattern)

    观察者模式:定义了对象之间一对多的依赖关系,这样一来,当一个对象的状态发生改变时,它的依赖者将会受到通知并且自动更新. 有一个模式可以帮你的对象知悉现况,不会错过该对象感兴趣的事,对象甚至在运行时可以 ...

  9. 评价早期SaaS创业公司时,投资人在关注什么?(是否有机会发展成一个平台,长期的护城河)

    编者按: 当聊到早期项目时,人们经常会问投资人一个问题:“在评价早期 SaaS 创业公司时,投资人会关注什么——指标还是其他方面?” Nakul Mandan 作为 Lightspeed 风投机构的合 ...

  10. Boost程序库完全开发指南——深入C++“准”标准库(第3版)

    内容简介  · · · · · · Boost 是一个功能强大.构造精巧.跨平台.开源并且完全免费的C++程序库,有着“C++‘准’标准库”的美誉. Boost 由C++标准委员会部分成员所设立的Bo ...