共 2 篇文章 |
|
UIAutomator定位Android控件的方法实践和建议(Appium姊妹篇)2.1 UISelector.text方法[java] view plaincopyaddNote = new UiObject(new UiSelector().text("Add note")); assertEquals(addNote.getText(),"Add note"); 该方法通过直接查找当前界面上所有的控件来比较每个控件的text属性是否如预期值来定位控件,挺好理解... 阅190 转1 评0 公众公开 15-03-02 23:53 |
// textview1UiObject obj = new UiObject(new UiSelector().className("android.widget.TextView").instance(2));// 获取View控件UiObject flObj = viewObj.getChild(new UiSelector().index(1)); // 获取FrameLayout控件UiObject llObj = flObj.getChild(new UiSelector().index(0)); // 获取LinearLayout控件UiObject tv1Obj = ll... 阅525 转0 评0 公众公开 15-03-02 23:53 |