实际上不可能执行“鼠标悬停”动作,而是需要一次性链接所有要实现的动作。因此,移至显示其他元素的元素,然后在同一链中,移至现在显示的元素,然后单击它。
使用动作链时,必须记住要“像用户那样做”。
Actions action = new Actions(webdriver);WebElement we = webdriver.findElement(By.xpath("html/body/div[13]/ul/li[4]/a"));action.moveToElement(we).moveToElement(webdriver.findElement(By.xpath("/expression-here"))).click().build().perform();


