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();
}
}
第一个测试例子 发短信sendMessage
最新推荐文章于 2019-11-05 11:41:38 发布