<分区>
Possible Duplicate:
Is there a proved mouseOver workaround for FirefoxDriver in Selenium2?
我希望能够使用 Java Selenium2 API 将鼠标悬停在 WebElement 上。那可能吗?我正在使用当前的 beta 3。
<分区>
Possible Duplicate:
Is there a proved mouseOver workaround for FirefoxDriver in Selenium2?
我希望能够使用 Java Selenium2 API 将鼠标悬停在 WebElement 上。那可能吗?我正在使用当前的 beta 3。
最佳答案
这将帮助您:
WebElement elems=driver.findElement(By.linkText("Custom Development"));//Menu Item
WebElement elems1=driver.findElement(By.xpath("//li[@id='item-465']/a"));//Menu
Actions builder = new Actions(driver);
Actions hoverOverRegistrar = builder.moveToElement(elems1);
hoverOverRegistrar.perform();
elems.click();//at last Menu Item Click
关于java - 在 Java 中使用 Selenium 2 将鼠标悬停在 WebElement 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6245690/