51Testing软件测试论坛

标题: Monkeyrunner 如何通过BY取同名ID,且能触发不是首个ID事件 [打印本页]

作者: ttplayer2006    时间: 2014-11-23 00:09
标题: Monkeyrunner 如何通过BY取同名ID,且能触发不是首个ID事件
请教大神
一个ANDROID应用,有一个列表,每个列表的ID名相同,如何用Monkeyrunner 通过By,去触发非首个ID名的列表?

作者: jiazurongyu    时间: 2014-11-25 12:37
1)因为是列表的id,需要touch方法获取坐标。
2)取得控件上的文本的getTextById(self,id)。
3)根据列表的坐标来制定父节点和子节点,确定索引关系
4)children[index]属性确定子节点的引用。
5)getchildview="hierarchyViewer.findViewById('" + parentId +"')
6)By.id('id/login_button'),MonkeyDevice.DOWN_AND_UP来调用所需要的控件id
作者: ttplayer2006    时间: 2014-11-25 23:20
jiazurongyu 发表于 2014-11-25 12:37
1)因为是列表的id,需要touch方法获取坐标。
2)取得控件上的文本的getTextById(self,id)。
3)根据列表 ...

能否举个例子
作者: cuikejie123    时间: 2016-5-28 18:35
二楼的回答很牛逼




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2