老李分享: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. JavaWeb验证码的使用

    在Java Web开发中,我们经常需要使用到验证码功能,一般情况下,我们可以将产生的验证码保存到服务器端中的session中,这种方式中,是使用服务器来保证验证码的功能.另外,我们也可以采用js产生验 ...

  2. Cassandra 学习笔记 - 1 - 关于Cassandra

    摘要 - Cassandra 的历史 Cassandra能做什么 Apache Cassandra最早是Facebook为了改进他们的Inbox搜索功能,由Avanash Lakshman和Prash ...

  3. JavaScript中国象棋程序(0) - 前言

    “JavaScript中国象棋程序” 这一系列教程将带你从头使用JavaScript编写一个中国象棋程序.希望通过这个系列,我们对博弈程序的算法有一定的了解.同时,我们也将构建出一个不错的中国象棋程序 ...

  4. 纪中集训 Day1

    今天早上起来吃饭,发现纪中伙食真的是太差了!!!什么都不热,早餐的面包还好,然后就迎来了美好的早晨= = 早上做一套题,T1T2果断秒,T3一看就是noi原题,还好看过题解会写,然后就愉快的码+Deb ...

  5. flume-sink报错 java.lang.IllegalStateException: close() called when transaction is OPEN - you must either commit or rollback first

    1. 确认代码无误(根据情况修改,表示若获得不了数据不会自动commit或者rollback): Event event = channel.take(); if (event == null) { ...

  6. 精通gulp常用插件

    本文主要展示的是gulp常用插件的使用方法和用途,通过对插件的熟练运用达到精通gulp.不定期更新.可以到github上面下载DEMO. github地址:lin-xin/gulp-plugins 匹 ...

  7. Markdown语法收录

    引言 Markdown编辑模式的写法在写博客以及生成简单的页面都有一定的使用,这里只收录Markdown的一些语法供以后查阅使用.具体使用手册可详见Markdown 语法说明(简体中文版) 正文 段落 ...

  8. SSIS 数据流的连接和查找转换

    在SSIS的数据流组件中,SSIS引擎使用Merge Join组件和 Lookup组件实现TSQL语句中的inner join 和 outer join 功能,Lookup查找组件的功能更类似TSQL ...

  9. jquery考试纠错笔记.

    1. 获取元素范围大小顺序依次为: $(#one).siblings("div")>$("#one~div")>$("#one +div& ...

  10. 【2017-2-17】VS基本应用及C#基础第一节(定义变量、输入及输出)

    一VS基本应用 (一)新建项目 新建项目可有多种方法例如: 1.  在VS起始页面建立新项目 2.  在集成环境中,通过"文件"/"新建"/"项目&q ...