我在为Android做Appium,并且我已经知道如何使用scrollIntoView()查找元素。如何使用MobileElement在Appium Android中查找它的兄弟姐妹
我的表是这样的:
(2)TableLayout
(0)TableRow
(0)LinearLayout
(1)LinearLayout
(0)TextView:Tom
(1)TextView:OPEN
(2)TextView:OPEN
(1)TableRow
(0)LinearLayout
(1)LinearLayout
(0)TextView:Jack
(1)TextView:OPEN
(2)TextView:OPEN
正如我上面提到的,我可以找到(0)的TextView文本“汤姆”和ID。但是,我想要的是找到(1)TextView并单击它。有什么办法可以做到吗?
我在寻找类似:
MobileElement tom = the (0)TextView I located;
MobileElement target = tom.findElement(__);
target.click();
它实际上工作,但我必须使用驱动程序,而不是汤姆。 –