【发布时间】:2016-11-08 13:50:39
【问题描述】:
如何在具有特定索引的线性布局中找到一个元素,如在图像中获得的那样,我有这个元素 android.widget.EditText,它的索引为 3。当我尝试使用搜索参数找到它时:
driver.FindElement(By.XPath("//android.widget.EditText[@index='3']")).SendKeys("123");
我也试过了 driver.FindElementByXPath("//*[@class='android.widget.EditText' and @index='3']").SendKeys("123");
我得到了这个异常
{"An element could not be located on the page using the given search parameters."}
如何选择这个元素?
【问题讨论】: