nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.78k stars 1.31k forks source link

safaridriver v12 /displayed endpoint doesn't work #2136

Closed max-cross closed 5 years ago

max-cross commented 5 years ago

Hello. I read a lot of information but didn't find an answer to it. I use safaridriver v12 and nightwatch 1.1.12. When I run my tests I see the error message Error while running .isElementDisplayed() protocol action: The command 'GET /session/ID/element/ID/displayed' was not found. Could somebody help with it?

vlad-vinogradov commented 5 years ago

Safari v12 WebDriver supports the W3C endpoints by default. displayed endpoint isn't supported in this mode.

Try to use legacy JSON Wire protocol with safaridriver's --legacy option and Nightwatch setting:

webdriver: {  use_legacy_jsonwire: true  }
max-cross commented 5 years ago

It doesn't work. When I tried to run it in legacy mode there was a message: --w3c and --legacy options no longer have any effect, and may be removed in the future. safaridriver only supports the protocol as defined by the W3C WebDriver specification.

vlad-vinogradov commented 5 years ago

Well... then the only thing that remains is to contact Safari support service and try to convince them to re-enable displayed endpoint in w3c mode.
Chromedriver team has implemented this wish.

max-cross commented 5 years ago

Seems yes. Thanks for the help

vlad-vinogradov commented 5 years ago

... or you can replace ...Visible methods with ...Present and appropriate CSS checks.

max-cross commented 5 years ago

It is a good idea actually :) Really! Thanks. I tried to replace all methods into Present and this issue is gone but another one appeared. I don't know why but now Safari says Error while running .clickElement() protocol action: The requested element is not pointer or keyboard interactable. Do you know why?

vlad-vinogradov commented 5 years ago

Maybe DOM element is not yet visible for "interaction" - has right CSS but is not yet rendered from the browser's point of view. Make short pause before click.