从类似元素的列表中,我能够获得我想要的元素。
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);