Nightwatch FireFox60和geckodriver MoveTo因未知命令而失败

时间:2019-07-09 14:25:08

标签: firefox geckodriver nightwatch

我是Nightwatch的新用户,正在尝试将大量测试转换为使用Nightwatch 1.1.12的最新版本。我的要求是使用以下设置:

Nightwatch 1.12.1
Firefox 60.8.0esr and Chrome 74
Gecko driver 1.7.1  (equates to gecko driver 0.17.1) 
see https://github.com/vladikoff/node-geckodriver#readme

我从Nightwatch网站仓库https://github.com/nightwatchjs/nightwatch-website-tests中克隆了一个示例设置和测试, 在我的仓库中:

https://github.com/kblodget/nightwatch-website-tests-config

我修改了homepage-test.js测试,将其移至GitHub按钮,单击它,然后确认GitHub页面已打开。

该测试在chrome中有效,但是当我使用FireFox和所需的gecko驱动程序运行相同的测试时失败。 Firefox错误是

TimeoutError: An error occurred while running .moveToElement() command on <Section [name=indexContainer],Section [name=download],Element [name=@gitHubButton]>:
   {"status":-1,"value":{"error":"unknown command","message":"POST /session/28e06a8d-7e6c-436a-81b7-149230ff226b/moveto did not match a known command","stacktrace":"stack backtrace:\n   0:           0x57af6d - backtrace::backtrace::trace::h59229d13f6a8837d\n   1:           0x57b0c2 - backtrace::capture::Backtrace::new::h23089c033eded8f0\n   2:           0x4472fc - webdriver::error::WebDriverError::new::h0b226f62ff19e120\n   3:           0x439986 - <webdriver::server::HttpHandler<U> as hyper::server::Handler>::handle::h8a591087754286a9\n   4:           0x42d1cf - hyper::server::listener::spawn_with::{{closure}}::h82d502303a553f20\n   5:           0x4092d7 - std::panicking::try::do_call::h89ac8aec5c3b6b89\n   6:           0x5de23a - panic_unwind::__rust_maybe_catch_panic\n                        at /checkout/src/libpanic_unwind/lib.rs:98\n   7:           0x41bd6e - <F as alloc::boxed::FnBox<A>>::call_box::h2822c178036f43e7\n   8:           0x5d68d4 - alloc::boxed::{{impl}}::call_once<(),()>\n                        at /checkout/src/liballoc/boxed.rs:650\n                         - std::sys_common::thread::start_thread\n                        at /checkout/src/libstd/sys_common/thread.rs:21\n                         - std::sys::imp::thread::{{impl}}::new::thread_start\n                        at /checkout/src/libstd/sys/unix/thread.rs:84"},"errorStatus":"","error":"POST /session/28e06a8d-7e6c-436a-81b7-149230ff226b/moveto did not match a known command","httpStatusCode":404}
       at <anonymous>
       at process._tickCallback (internal/process/next_tick.js:188:7)

我已经通过过去的问题对此进行了研究,并认为该问题与此相关

https://github.com/nightwatchjs/nightwatch/issues/1664

从此来源来看,壁虎驱动程序不支持moveTo命令命令,并已由Actions API实现取代。

有趣的是,当我更新nightwatch.conf.js文件以使用Firefox版本60和gecko驱动程序至1.16.2(gecko驱动程序v0.24.0)时,我遇到了相同的错误

那么如何在Firefox 60浏览器中运行这些测试?如果我需要创建一个自定义命令来使用API​​动作,该怎么做?

更新1:

我意识到这是geckodriver无法完全实现WebDriver标准或与Selenium完全兼容的问题,但是我需要一种方法来修复这些测试。

0 个答案:

没有答案
相关问题