Nightwatch FireFox60 and geckodriver MoveTo fails with unknown command
Asked 07 September, 2021
Viewed 2.4K times
  • 56
Votes

I am a new user to Nightwatch and am trying to convert a large number of tests to use the latest version of Nightwatch 1.1.12. My requirements are to use the following set up:

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

I have a sample setup and tests cloned from the Nightwatch website repo, https://github.com/nightwatchjs/nightwatch-website-tests, at my repo:

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

I have modified the homepage-test.js test to move to the GitHub button , click it, then verify the GitHub page is opened.

This test works in chrome, but fails when I run the same test using FireFox and the required gecko driver. The Firefox error is

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:
   0:           0x57af6d - backtrace::backtrace::trace::h59229d13f6a8837d
   1:           0x57b0c2 - backtrace::capture::Backtrace::new::h23089c033eded8f0
   2:           0x4472fc - webdriver::error::WebDriverError::new::h0b226f62ff19e120
   3:           0x439986 - <webdriver::server::HttpHandler<U> as hyper::server::Handler>::handle::h8a591087754286a9
   4:           0x42d1cf - hyper::server::listener::spawn_with::{{closure}}::h82d502303a553f20
   5:           0x4092d7 - std::panicking::try::do_call::h89ac8aec5c3b6b89
   6:           0x5de23a - panic_unwind::__rust_maybe_catch_panic
                        at /checkout/src/libpanic_unwind/lib.rs:98
   7:           0x41bd6e - <F as alloc::boxed::FnBox<A>>::call_box::h2822c178036f43e7
   8:           0x5d68d4 - alloc::boxed::{{impl}}::call_once<(),()>
                        at /checkout/src/liballoc/boxed.rs:650
                         - std::sys_common::thread::start_thread
                        at /checkout/src/libstd/sys_common/thread.rs:21
                         - std::sys::imp::thread::{{impl}}::new::thread_start
                        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)

I've researched this through past issues and believe the issue is related to this

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

From this source the gecko driver does not support the moveTo command command and has been replaced with the Actions API implementation.

Interesting though I have the same error when I update the nightwatch.conf.js file to use Firefox version 60 and the gecko driver to 1.16.2 (gecko driver v0.24.0)

So how can I run these test in Firefox 60 browser? If I need to create a custom command to use the API actions, how is that done?

Update 1:

I realize this is an issue with geckodriver not fully implementing the WebDriver standard or complete compatibility with Selenium but I need a way to fix these tests.

0 Answer