当创建一个UiScrollable对象时,如果指定的参数是new UiSelector().scrollable(true),那么会出现以下问题
//Find out the new added note entry UiScrollable noteList = new UiScrollable( new UiSelector().scrollable(true)); //would be null if the scrollable widget's not more than one page UiObject note = null;
note = noteList.getChildByText(new UiSelector().className("android.widget.TextView"), "Note1", true);
<pre name="code" class="java"> assertThat(note,notNullValue());note.longClick();
//Find out the new added note entry UiScrollable noteList = new UiScrollable( new UiSelector().scrollable(true)); UiObject note = null;
if(noteList.exists()) { note = noteList.getChildByText(new UiSelector().className("android.widget.TextView"), "Note1", true); } else { note = new UiObject(new UiSelector().text("Note1")); } assertThat(note,notNullValue()); note.longClick();
//Find out the new added note entry UiScrollable noteList = new UiScrollable( new UiSelector().className("android.widget.ListView")); UiObject note = null; note = noteList.getChildByText(new UiSelector().className("android.widget.TextView"), "Note1", true); assertThat(note,notNullValue()); note.longClick();
作者 | 自主博客 | 微信 | CSDN |
天地会珠海分舵 | http://techgogogo.com | 服务号:TechGoGoGo 扫描码:
| 向AI问一下细节 免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。 猜你喜欢最新资讯相关推荐相关标签AI
助 手 |