老李分享: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的更多相关文章

  1. 老李分享:robotium常用API 2

    断言: 具体请查看官网 断言方法assert(robotium特有的断言方式,实际项目中和Junit的assert方法配合使用) void assertCurrentActivity (String ...

  2. robotium从入门到放弃 四 Robotium常用API

      获取控件 getText() getEditText() getButton() getImage() getImageButton() getEditText() getView() getWe ...

  3. 老李分享:Robotium创建Note的实例

    老李分享:Robotium创建Note的实例   poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试,性能测试,测试工具开发等工作为目标.如果对课程感兴趣,请大家咨询qq ...

  4. 老李分享:Robotium编写测试用例如何模拟Junit4的BeforeClass和AfterClass方法1 - 条件判断法

    老李分享:Robotium编写测试用例如何模拟Junit4的BeforeClass和AfterClass方法1 - 条件判断法   poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜 ...

  5. 老李分享:jvm结构简介 1

    老李分享:jvm结构简介     poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试,性能测试,测试工具开发等工作为目标.如果对课程感兴趣,请大家咨询qq:9088214 ...

  6. 分享一个常用Adb命令

    分享一个常用Adb命令 首先 首先感谢@xuxu的常用adb命令,收益良多,但是已经不能满足于我,所以补充了下. 再者 好久没发帖了,最近论坛老司机们都在讨论/总结,我就用这个干货回报吧. 最后 基于 ...

  7. html5常用API之Full Screen

    所谓Full Screen API,就是全屏API,在html5中,该API允许开发者以编程方式将Web应用程序全屏运行,使Web应用程序更像本地应用程序.这款API十分简单有用,是html5初学者必 ...

  8. 老李分享:接口测试之jmeter

    老李分享:接口测试之jmeter   poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试,性能测试,测试工具开发等工作为目标.移动端自动化测试很多人把他仅仅理解成appu ...

  9. 老李分享:持续集成学好jenkins之解答疑问

    老李分享:持续集成学好jenkins之解答疑问   poptest(www.poptest.cn)在培训的过程中使用jenkins搭建持续集成环境,让学员真正交流持续集成到底是什么,怎么去做的. Je ...

随机推荐

  1. B. Pasha and Phone

    B. Pasha and Phone time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  2. 【Scala】Scala之Classes and Properties

    一.前言 前面学习了控制结构,下面学习Scala的Class和Properties. 二.Class&Properties 尽管Scala和Java很类似,但是对类的定义.类构造函数.字段可见 ...

  3. Python从入门到放弃之迭代器

    迭代器是Python2.1中新加入的接口(PEP 234),说明如下: The iterator provides a 'get next value' operation that produces ...

  4. 关于echarts的一些基本使用demo

    最近发现一个很好用的一个前端控件echarts,效果非常不错,兼容ie8+以上等主流浏览器.可以使用它制作报表,地图示意图等,可用其实现一系列强大的功能. 其基于html5 Canvas,是一个纯Ja ...

  5. angular : ng-options

    基本调用,得到name 属性 <select ng-model="target" ng-options="obj.name as obj.name for obj ...

  6. RAC之常用方法-----新手入门

    年后换工作新入职,公司开发在使用RAC,之前居然一直没有了解过,独立开发的弊端,信息闭塞,而且自己也懒,这几天看了下RAC,确实很强大有木有. 什么是ARC 简单的说,RAC就是一个第三方库,他可以大 ...

  7. Node.js~在linux上的部署~外网不能访问node.js网站的解决方法

    这是上一篇node.js部署到linux上的后续文章,当我们安装完node.js之后,建立了sailsjs的网站,然后在外面电脑上无法访问这个网站,这个问题我们如何去解决? 解决思路: 查看linux ...

  8. Asp.Net MVC学习总结(三)——过滤器你怎么看?

    一.过滤器简介 1.1.理解什么是过滤器 1.过滤器(Filters)就是向请求处理管道中注入额外的逻辑.提供了一个简单而优雅的方式来实现横切关注点. 2.所谓的过滤器(Filters),MVC框架里 ...

  9. mfc---ActiveX控件

    AvtiveX控件可看做是一个极小的服务器应用程序,不能独立运行,必须嵌入到某个容器程序中 容器应用程序:可以嵌入或链接对象的应用程序 服务器应用程序:创建对象并且当对象被双击时,可以被启动的应用程序 ...

  10. Flume-ng源码解析之Sink组件

    作为启动流程中第二个启动的组件,我们今天来看看Sink的细节 1 Sink Sink在agent中扮演的角色是消费者,将event输送到特定的位置 首先依然是看代码,由代码我们可以看出Sink是一个接 ...