Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo 动作异常

Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception

同时使用 SauceLabs 中任何可用的 OS(除了 Linux,最新可用的 Firefox 版本太旧),通过执​​行以下 ActionChain:

hover = ActionChains(driver)
hover.move_to_element(elm_Men_Menu).perform()

它抛出以下错误:

追溯:

File [...] in testHover
hover.perform()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/action_chains.py", line 80, in perform
action()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/action_chains.py", line 290, in <lambda>
                                                                                                              Command.MOVE_TO, {'element': to_element.id}))
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 256, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
WebDriverException: Message: mouseMoveTo
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'itako44164.prod.miso', ip: '[...]', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.1', java.version: '1.8.0_112'
Driver info: driver.version: RemoteWebDriver
Stacktrace:
at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode (AbstractHttpCommandCodec.java:220)
at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode (AbstractHttpCommandCodec.java:118)
at org.openqa.selenium.remote.HttpCommandExecutor.execute (HttpCommandExecutor.java:158)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute (DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute (RemoteWebDriver.java:637)
at org.openqa.selenium.remote.RemoteExecuteMethod.execute (RemoteExecuteMethod.java:35)
at org.openqa.selenium.remote.RemoteMouse.mouseMove (RemoteMouse.java:89)
at org.openqa.selenium.support.events.internal.EventFiringMouse.mouseMove (EventFiringMouse.java:58)
at org.openqa.selenium.remote.server.handler.interactions.MouseMoveToLocation.call (MouseMoveToLocation.java:59)
at org.openqa.selenium.remote.server.handler.interactions.MouseMoveToLocation.call (MouseMoveToLocation.java:32)
at java.util.concurrent.FutureTask.run (FutureTask.java:266)
at org.openqa.selenium.remote.server.DefaultSession.run (DefaultSession.java:176)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
at java.lang.Thread.run (Thread.java:745)

本地运行完美。我正在使用 geckodriver 0.17.0 和 Selenium 3.4.3(已编辑)。这是先前报告的 Selenium 错误,但已针对 Selenium 3.x 和 geckodriver 0.15.0 (https://github.com/SeleniumHQ/selenium/issues/2285). For the SauceLabs test I am using Selenium 3.4.0 (as can be seen in the error report) and in SauceLabs documentation, for Firefox 53 and higher versions, geckodriver 0.16.0 is used (https://wiki.saucelabs.com/display/DOCS/Test+Configuration+Options#TestConfigurationOptions-SeleniumVersion) 解决,原则上应该支持 move_to_element() 操作。

我做错了什么吗?有没有办法指定 geckodriver 版本?到目前为止,所需的功能如下所示:

desired_cap = {
  'platform':"Mac OS X 10.12",
  'browserName':"firefox",
  'version':"54",
  'seleniumVersion':"3.4.0",
}

编辑 1:我没有提到它,但它适用于 Chrome 和 IE11

编辑2:在Linux中使用selenium独立服务器(3.4.0)在本地执行代码时出现同样的问题。 geckodriver 版本为 0.17.0。完全相同的回溯,除了 System info: host:

已解决:

Selenium 已经意识到这个问题:

https://github.com/SeleniumHQ/selenium/issues/4008

已经解决,将在3.5版本中可用:

https://github.com/SeleniumHQ/selenium/issues/3808#issuecomment-311105917

现在可以解决克隆主存储库,自己构建 selenium 服务器并使用 -enablePassThrough 标志启动节点