uiautomator 测试放到真机里执行,报错,有没大虾可以支持一下
网上找的一个简单例子
package com;
import com.android.uiautomator.core.UiObject;
import com.android.uiautomator.core.UiObjectNotFoundException;
import com.android.uiautomator.core.UiScrollable;
import com.android.uiautomator.core.UiSelector;
import com.android.uiautomator.testrunner.UiAutomatorTestCase;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
public class Runner extends UiAutomatorTestCase {
public void testDemo() throws UiObjectNotFoundException {
getUiDevice().pressHome();
UiObject settingApp = new UiObject(new UiSelector().text("Settings"));
settingApp.click();
try {
Thread.sleep(3000);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
UiScrollable settingItems = new UiScrollable( new UiSelector().scrollable(true));
UiObject languageAndInputItem = settingItems.getChildByText(
new UiSelector().text("Language & input"), "Language & input", true);
languageAndInputItem.clickAndWaitForNewWindow();
}
}
例子来原:http://blog.csdn.net/g19920917/article/details/16131565 测试用机子为MT15I(android 4.1.2)而我的project.properties 里为target=android-22,不知道是不是这个原因,有没有人遇到我这情况
:lol自已经找到答案,真心杯具 什么原因呢?现在正困惑,找不到原因 ttplayer2006 发表于 2015-7-16 23:21
自已经找到答案,真心杯具
能不能公布一下答案?
页:
[1]