Actions类不使用gecko驱动程序

nav*_*mar 13 action geckodriver

我遇到了Actions班级司机的问题.我有这段代码

Actions act= new Actions(d1);
act.moveToElement(d1.findElement(By.xpath("path of the element")).build().perform();
Run Code Online (Sandbox Code Playgroud)

以前当我使用时Selenium-Java 2.43.0,此命令工作正常.但我升级到3.0.0-beta2,开始firefox driver通过壁虎驱动程序访问.

在上面指定的命令中,我的测试失败了.我得到以下例外

org.openqa.selenium.UnsupportedCommandException:POST/session/21dfc828-a382-4622-8c61-89bc48e29744/moveto与已知命令不匹配(警告:服务器未提供任何堆栈跟踪信息)命令持续时间或超时:4毫秒

请帮忙

jib*_*bbs 5

在他们解决这个问题之前,临时的,可怕的,令人沮丧的答案是恢复到Selenium和Firefox的工作版本.使用Firefox 45.0.2的Selenium 2.53.0仍在运行:https://ftp.mozilla.org/pub/firefox/releases/45.0.2/

我很遗憾没有对最新的测试进行测试,但与此同时它没有任何Firefox测试运行.几个月没有针对Firefox运行是不可接受的.


小智 5

这是版本问题.Selenium 3还没有支持Actions类驱动程序.您必须下载到较低版本.使用Firefox版本2.53.1适用于我