【发布时间】:2016-03-02 15:16:43
【问题描述】:
在我的应用中,我需要单击一个子元素,但由于某种原因它无法正常工作。
这是父元素:
WebElement element = device.getDriverWrapper().getIosDriver().findElement(By.xpath("//UIACollectionView[1]/UIACollectionCell[4]"));
这个元素包含文本视图和一个锁。我需要按下锁。
这是子元素:
WebElement child = element.findElement(By.xpath("//UIAButton[1]"));
child.click();
知道我做错了什么吗?
谢谢
【问题讨论】:
-
你需要父元素吗?您是否有理由不只使用“//UIACollectionView[1]/UIACollectionCell[4]/UIAButton[1]”?