第一个测试例子 发短信sendMessage
2015-05-16 15:43
295 查看
package com.sprd.test.uiautomator.message; import com.android.uiautomator.core.UiDevice; import com.android.uiautomator.core.UiObject; import com.android.uiautomator.core.UiObjectNotFoundException; import com.android.uiautomator.core.UiSelector; import com.android.uiautomator.testrunner.UiAutomatorTestCase; public class MessageTest extends UiAutomatorTestCase{ public void test_Send() throws UiObjectNotFoundException { // UiDevice uidevice = getUiDevice(); uidevice.pressHome(); UiObject message = new UiObject (new UiSelector().text("信息")); message.clickAndWaitForNewWindow(); UiObject newmessage = new UiObject (new UiSelector().resourceId("com.android.mms:id/action_compose_new")); newmessage.clickAndWaitForNewWindow(); UiObject messageto = new UiObject (new UiSelector().text("收件人")); messageto.clickAndWaitForNewWindow(); // String phoneno = "13821568572"; messageto.setText(phoneno); UiObject typemessage = new UiObject (new UiSelector().text("键入信息")); typemessage.clickAndWaitForNewWindow(); String txt="message sending >>>>"; typemessage.setText(txt); UiObject sendmessage = new UiObject (new UiSelector().resourceId("com.android.mms:id/send_button_sms")); sendmessage.clickAndWaitForNewWindow(); UiObject chooseformat = new UiObject (new UiSelector().text("中国移动 01")); chooseformat.click(); } }
相关文章推荐
- 键盘过滤第一个例子ctrl2cap(4.1~4.4)汇总,测试
- 测试驱动开发的第一个例子---我的毕业设计
- 我的Firefox插件开发之旅(5)——编译和测试第一个Plugin例子:npruntime
- java第一个类的测试小例子
- SparkR的第一个测试例子Spark Pi计算
- (转载)我的第一个ACE测试例子(Linux和Windows)
- JRTPLIB的编译和第一个测试例子
- 我的Firefox插件开发之旅(5)——编译和测试第一个Plugin例子:npruntime(转载)
- 今天使用Django测试第一个小例子的时候,遇到了NameError: name 'include' is not defined错误
- Firefox插件开发(5)——编译和测试第一个Plugin例子:npruntime
- 我的Firefox插件开发之旅(5)——编译和测试第一个Plugin例子:npruntime
- VS2005+WINDDK+Driver Studio 3.2编译出第一个测试驱动程序
- UNIX环境高级编程第一个例子myls.c
- Mysql 加密、解密函数测试例子
- delphi 三层架构简单例子(经测试成功)
- 【深度学习】笔记2_caffe自带的第一个例子,Mnist手写数字识别代码,过程,网络详解
- 我的第一个vb实例--红楼梦测试小程序
- MySQL中group by测试例子
- [数据库测试]强烈推荐一个python ODBC数据源插件,可支持Oracle,Db2,Mysql,Sql-server以及各种数据库版本,附例子和测试程序
- 《Unix网络编程卷1-套接字联网API》第一个例子编译