问题描述
我有一个在 Chrome 上运行完美的自动化基础设施,但在 Firefox 上有几个问题。
我目前正在尝试解决的问题是将鼠标悬停在带有 Actions
的元素上。
这个方法
public void hoverOverElement(By element){
action = new Actions(driver);
webElement = driver.findElement(element);
action.movetoElement(webElement).build().perform();
}
与 Chrome 完美配合,但与 Firefox 一起使用时,元素似乎不会悬停在它上面。
通过将鼠标悬停在该元素上,几个元素(按钮)通常会出现在那里。同样,它在 Chrome 和 Firefox 上以及在 Chrome 上使用 Selenium 都可以完美地手动运行。但它不适用于 Firefox 上的 Selenium。
我有最新版本的 Firefox 和最新版本的 geckodriver.exe
我在这里的几篇文章中看到了设置的建议
FirefoxProfile profile = new FirefoxProfile();
profile.setEnableNativeEvents(true);
但是这会产生以下错误
Cannot resolve method 'setEnableNativeEvents' in 'FirefoxProfile'
非常感谢您的帮助!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)