老李分享: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 ...
随机推荐
- 每天一个linux命令(40)--route命令
Linux 系统的route 命令用于显示和操作IP路由表(show /manipulate the ip routing table).要实现两个不同的子网之间的通信,需要一台连接两个网络的路由器, ...
- Server push(服务器推送技术)
一.服务器推送技术Server Push详解: 推送技术Server Push的基础思想是将浏览器主动查询信息改为服务器主动发送信息.服务器发送一批数据,浏览器显示这些数据,同时保证与服 ...
- 【Harmony】概述
原文来自本人的微信公众号文章 系统工程实验室 引言 基于模型的系统工程(简称MBSE,英文全称Model based System Engineering )的实践至少需要三个维度的支撑 ...
- Lowest Common Ancestor of a Binary Tree leetcode
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According ...
- UVa 1588 换抵挡装置
前言 题目 大意是说,两个槽能够插在一起,并保证每一列的高度不高于3,保证最短长度. 思路 思路很简单,取短字符串遍历长字符串的每一个位置,纪录下位置,并取最短即可. 实现 //习题3-11 换抵挡装 ...
- 初次接触java中的递归算法
一道关于兔子繁衍的编程题: 有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第三个月后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少? 自己考虑了挺久,思路出现了问题,甚至连 ...
- Mditor 发布「桌面版」了 - http://mditor.com
简单说明 Mditor 最早只有「组件版」,随着「桌面版」的发布,Mditor 目前有两个版本: 可嵌入到任意 Web 应用的 Embed 版本,这是一桌面版的基础,Repo: https://git ...
- 算法模板——KMP字符串匹配
功能:输入一个原串,再输入N个待匹配串,在待匹配串中找出全部原串的起始位置 原理:KMP算法,其实这个东西已经包含了AC自动机的思想(fail指针/数组),只不过适用于单模板匹配,不过值得一提的是在单 ...
- 深入理解java String 及intern
一.字符串问题 字符串在我们平时的编码工作中其实用的非常多,并且用起来也比较简单,所以很少有人对其做特别深入的研究.倒是面试或者笔试的时候,往往会涉及比较深入和难度大一点的问题.我在招聘的时候也偶尔会 ...
- Cesium原理篇:3D Tiles(2)数据结构
上一节介绍3D Tiles渲染调度的时候,我们提到目前Cesium支持的Cesium3DTileContent目前支持如下类型: Batched3DModel3DTileContent Instanc ...