UI??????ü???
???????????? ???????[ 2014/4/30 14:08:17 ] ????????UI ????
????????????????в???????ListView?е????????????Apps????????
UiObjectappItem=newUiObject(newUiSelector()
.className("android.widget.ListView").instance(1)
.childSelector(newUiSelector().text("Apps")));
??????β?????????????е????????????????
????UiObjectcancelButton=newUiObject(newUiSelector().text("Cancel"));
????UiObjectokButton=newUiObject(newUiSelector().text("OK"));
???????????UiObject?????????????????????????á?????????????????UiObject???????????uiautomator??????????????2????????
???????′???uiautomator???????????????????????“OK”????????????????????????????????????
if(okButton.exists()&&okButton.isEnabled())
{
okButton.click();
}
????????????????????????????????????????′????????????“Cancel”??“OK”??android.widget.Button????????
UiObjectcancelButton=newUiObject(newUiSelector().text("Cancel")
.className("android.widget.Button"));
UiObjectokButton=newUiObject(newUiSelector().text("OK")
.className("android.widget.Button"));
UiCollection
???????????????????UiCollection??????UiObject????????UiSelector?????UiCollection???Android???е?ViewGroup?????????
???????′????????????UiSelector?????????????????UiCollection??
????UiCollectionvideos=newUiCollection(newUiSelector()
????.className("android.widget.FrameLayout"));
?????????????????LinearLayout?е?????????????·???????????????
????intcount=videos.getChildCount(newUiSelector()
????.className("android.widget.LinearLayout"));
?????????????????“CuteBabyLaughing”?????????????????????????·????
UiObjectvideo=videos.getChildByText(newUiSelector()
.className("android.widget.LinearLayout")??"CuteBabyLaughing");
video.click();
????????????????????????????????磬?????????????????£?
UiObjectcheckBox=video.getChild(newUiSelector()
.className("android.widget.Checkbox"));
if(!checkBox.isSelected())checkbox.click();
UiScrollable
????????????????????????UiScrollable???????????????????UI????????????????????????????????????????????????????????UiScrollable??
???????磬????????????????????????“Settings”????????“Abouttablet”??????????
UiScrollablesettingsItem=newUiScrollable(newUiSelector()
.className("android.widget.ListView"));
UiObjectabout=settingsItem.getChildByText(newUiSelector()
.className("android.widget.LinearLayout")??"Abouttablet");
about.click()
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11