【发布时间】:2013-06-22 01:09:29
【问题描述】:
我想在下拉菜单上执行鼠标悬停功能。当我们将鼠标悬停在菜单上时,它将显示新选项。 我尝试使用 xpath 单击新选项。但不能直接点击菜单。 因此,作为手动方式,我尝试将鼠标悬停在下拉菜单上,然后单击新选项。
Actions action = new Actions(webdriver);
WebElement we = webdriver.findElement(By.xpath("//html/body/div[13]/ul/li[4]/a"));
action.moveToElement(we).build().perform();
【问题讨论】:
-
查看本站了解详细答案 - testautomationguru.com/…
标签: java selenium selenium-webdriver mouseover