package Test;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;public class Demo extends UiAutomatorTestCase{?public void testDemo() throws UiObjectNotFoundException{??getUiDevice().pressHome();??//進入設置菜單??UiObject settingApp = new UiObject(new UiSelector().text("settings"));??settingApp.click();??//休眠3秒??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();?}}這是我寫的一個腳本,?getUiDevice().pressHome();這一步可以執行,到下面進入設置菜單就不行了,是哪里不對嗎
- 2 回答
- 0 關注
- 1410 瀏覽
添加回答
舉報
0/150
提交
取消