老李分享: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 ...
随机推荐
- UU农场平台开发 UU农场拆复利系统
UU农场平台开发 UU农场拆复利系统今年比较新的一款游戏,类似于QQ农场,但又加入了很多新型的互联网理财模式!UU农场平台开发 UU农场拆复利系统.UU农场开发.UU农场游戏平台开发.UU农场平台开发 ...
- 我个人的Java学习经验(一家之言)
声明:本文只是我的个人经验之谈,或者连经验之谈都算不上,因为我觉得自己还是个新手,没有什么经验可谈,就算是我分享一下自己从开始学习Java到现在的一些心路历程吧,各位看官暂且看吧,欢迎交流.第一部分算 ...
- C语言的基本概念
1.经典入门:hello world #include <stdio.h> int main(void) { printf("hello world.\n"); ; } ...
- SQL中的join连接查询
inner join(交集 ,自然连接, 简写成join) 是最普通的连接查询,相当于早期根据where条件连接的查询 outer join(并集或部分并集,左表 + 右表) le ...
- Ceph部署(二)RGW搭建
背景 Ceph RGW简介 Ceph RGW基于librados,是为应用提供RESTful类型的对象存储接口.RGW提供两种类型的接口: 1) S3:兼容Amazon S3RESTful API: ...
- java 抽象(abstract) 构造 静态(static) 总结--2017-03-02
抽象类:不能实例化!子类继承抽象类, 实例化子类对象才可以调用, 多态的体现; 抽象方法:必须被重写才能被调用; 静态方法:类名直接调用,或者实例化对象调用; 构造方法:new后面的括号里面带参数,就 ...
- 从0移植uboot (二) _uboot启动流程分析
经过了上一篇的配置,我们已经执行make就可以编译出一个uboot.bin,但这还不够,首先,此时的uboot并不符合三星芯片对bootloader的格式要求,同时,此时的uboot.bin也没有结合 ...
- XCel 项目总结 - Electron 与 Vue 的性能优化
XCEL 是由凹凸实验室推出的一个 Excel 数据清洗工具,其通过可视化的方式让用户轻松地对 Excel 数据进行筛选. XCEL 基于 Electron 和 Vue 2.0 进行开发,充分利用 E ...
- 1644: [Usaco2007 Oct]Obstacle Course 障碍训练课
1644: [Usaco2007 Oct]Obstacle Course 障碍训练课 Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 383 Solved ...
- UI 自定义视图 ,视图管理器
一>自定义label - textField 视图 自定义视图:系统标准UI之外,自己组合而出的新的视图 iOS 提供了很多UI组件 ,借助它们,我们可以做各种程序 尽管如此,实际开发中,我们还 ...