老李分享:robotium常用API 1
老李分享:robotium常用API
robotium常用API
Robotium中最重要的类Solo类:其中提供了模拟用户活动的点击、搜索、拖拽等方法。
英文api(经常断开连接打不开):http://www.jarvana.com/jarvana/view/com/jayway/android/robotium/robotium-solo/2.0.1/robotium-solo-2.0.1-javadoc.jar!/index-all.html
中文API: http://www.robotium.cn/archives/category/api/page/7
(源代码解析-Solo : http://www.robotium.cn/archives/1050)
典型方法:(更多方法及解释请查看以上api)
其中很多方法都是根据控件的索引值进行操作
① 点击:
clickOnButton(int)—Clickson a Button with a givenindex.根据索引值点击Button.
clickOnButton(String)—Clickson a Button with a giventext.根据文本点击Button.
clickOnCheckBox(int)—Clickson a CheckBox with a givenindex.
clickOnView(View)—Clickson a given View.
clickOnText(String)—Clickson a View displaying agiven text.
clickLongOnText(String)—Longclicks on a givenView.
clickOnRadioButton(int)—Clickson a RadioButton with a givenindex.
clickOnScreen(float, float)—Clickson a given coordinate on the screen.
② 取得:
getCurrentActivity()—Returnsthe current Activity.
getText(String)—Returnsa TextView which shows a given text.
getView(int)—Returnsa View with a given id.
getEditText(String)—Returnsan EditText which shows a given text.
getImage(int)—Returnsan ImageView with a given index.
③ 拖拽:
drag(float, float, float,float, int)—Simulate touching a given location anddragging it to a new location.
④ 搜索:
searchText(String)—Searchesfor a text string and returnstrue if at least one item is found with the expected text.
searchEditText(String)—Searchesfor a text string in the EditText objects located in the current Activity.
searchButton(String, boolean)—Searchesfor a Button with the given text string and returns true if at least one Buttonis found.
老李分享:robotium常用API 1的更多相关文章
- 老李分享:robotium常用API 2
断言: 具体请查看官网 断言方法assert(robotium特有的断言方式,实际项目中和Junit的assert方法配合使用) void assertCurrentActivity (String ...
- robotium从入门到放弃 四 Robotium常用API
获取控件 getText() getEditText() getButton() getImage() getImageButton() getEditText() getView() getWe ...
- 老李分享:Robotium创建Note的实例
老李分享:Robotium创建Note的实例 poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试,性能测试,测试工具开发等工作为目标.如果对课程感兴趣,请大家咨询qq ...
- 老李分享:Robotium编写测试用例如何模拟Junit4的BeforeClass和AfterClass方法1 - 条件判断法
老李分享:Robotium编写测试用例如何模拟Junit4的BeforeClass和AfterClass方法1 - 条件判断法 poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜 ...
- 老李分享:jvm结构简介 1
老李分享:jvm结构简介 poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试,性能测试,测试工具开发等工作为目标.如果对课程感兴趣,请大家咨询qq:9088214 ...
- 分享一个常用Adb命令
分享一个常用Adb命令 首先 首先感谢@xuxu的常用adb命令,收益良多,但是已经不能满足于我,所以补充了下. 再者 好久没发帖了,最近论坛老司机们都在讨论/总结,我就用这个干货回报吧. 最后 基于 ...
- html5常用API之Full Screen
所谓Full Screen API,就是全屏API,在html5中,该API允许开发者以编程方式将Web应用程序全屏运行,使Web应用程序更像本地应用程序.这款API十分简单有用,是html5初学者必 ...
- 老李分享:接口测试之jmeter
老李分享:接口测试之jmeter poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试,性能测试,测试工具开发等工作为目标.移动端自动化测试很多人把他仅仅理解成appu ...
- 老李分享:持续集成学好jenkins之解答疑问
老李分享:持续集成学好jenkins之解答疑问 poptest(www.poptest.cn)在培训的过程中使用jenkins搭建持续集成环境,让学员真正交流持续集成到底是什么,怎么去做的. Je ...
随机推荐
- 【图像浏览】FastStone Image Viewer——快速、小巧、功能强大
FastStone Image Viewer 是一款免费(非商业用途)且小巧的看图软件. 其在在appinn.com的我最喜爱的<图片/照片浏览查看工具>调查结果中排第6名(总提名 140 ...
- Codeforce 水题报告(2)
又水了一发Codeforce ,这次继续发发题解顺便给自己PKUSC攒攒人品吧 CodeForces 438C:The Child and Polygon: 描述:给出一个多边形,求三角剖分的方案数( ...
- 对JS关于对象创建的几种方式的整理
最近一直在看JS高级程序设计这本书,有空来梳理一下几种创建对象的方式.话不多说,直接步入正题. 第一种:Object构造函数创建 var Person = new Object();Person.na ...
- Angular2 路由问题修复 、求解
Angular2 提供了比angular1 更为强大的路由功能,但是在具体使用路由过程中,可是出现了很多路由不按照预想的方式执行的问题.为了说明今天的问题,我特地新建了一个测试工程.欢迎交流. 首先介 ...
- MongoDB的安装及恢复
在http://www.mongodb.org/display/DOCS/Downloads 下载对应版本 mongodb 安装数据库 解压文档,复制到c盘,改名为mongodb 新建文件夹c:/da ...
- php弱类型语言中的类型判断
1.php一个数字和一个字符串进行比较或者进行运算时,PHP会把字符串转换成数字再进行比较.PHP转换的规则的是:若字符串以数字开头,则取开头数字作为转换结果,若无则输出0. 例如:123abc转换后 ...
- Redis从入门到精通
什么是Redis? Redis是非关系型数据库,是一个高性能的key-value数据库,它是开源的,更是免费的. Redis能做什么? 存储数据 Redis的优点有哪些? 1.它支持存储丰富的数据类型 ...
- Android intent 笔记
学习android的intent,将其中的一些总结,整理的笔记记录于此. intent是一个消息传递对象,可以在不同组件间传递数据.Activity,Service,Broadcast Receive ...
- thinkphp apicloud 下拉刷新 。。。由于新人里面导入了vue.js
//刷新 apiready = function(){ var count; var i= 1; var param = {}; toDoRequest(); param.loadingImgae = ...
- SQLServer索引循环删除
declare qc_cursor cursor SCROLL OPTIMISTIC Forselect siteName from tb_vhostcheckopen qc_cursordeclar ...