从类似元素的列表中,我能够得到我想要的元素。
List<WebElement> expandQA = driver.findElements(By.xpath("//img[contains(@class, 'x-tree-expander')]/following-sibling::span[text()='QA']"))
expandQA.get(2);
现在我想双击那个元素。我怎么能那样做?
尝试使用以下代码,但出现错误。
Actions actions = new Actions(driver);
List<WebElement> expandQA = driver.findElements(By.xpath("//img[contains(@class, 'x-tree-expander')]/following-sibling::span[text()='QA']"));
e = expandQA.get(2);
actions.doubleClick(e);