-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nightwatch doesn't support W3C WebDriver standard #1456
Comments
And it's probably not the only thing that doesn't work. My test times out while waiting for an element to become visible when using geckodriver standalone. |
To be clear, this issue is actually about making Nightwatch compliant to the W3C WebDriver standard. geckodriver is currently the only driver that implements it. When geckodriver/Firefox is being used through the Selenium remote server, there is a shim that implicitly converts Selenium requests to W3C WebDriver request. This explains why calls being made directly to geckodriver fail. If Nightwatch wants to provide support for both Selenium’s protocol (which is being phased out) and the forthcoming WebDriver standard, it needs to go into legacy or conformance mode based on the handshake when creating a new session. W3C WebDriver conforming remote ends will return a JSON Object with a semi-top-level This is an example from geckodriver:
|
Can confirm I have this issue as well. I have tried running selenium standalone in order to have my requests to geckodriver routed through selenium instead, but no such luck yet. I will make sure my configuration is not incorrect, however. |
Here to confirm this issue: Geckodriver Logging
Nightwatch Output
|
Also having issues with running Nightwatch tests in Firefox. For example, |
@aamorozov I don't think that's related, you're using selenium, not geckodriver in standalone mode (without selenium). |
@nkovacs Yeah makes sense, will try using without selenium and update the comment here if still experience the issue |
That won't work at all with more recent versions of geckodriver (and older versions are very incomplete and buggy) because nightwatch doesn't support the standard that geckodriver uses. That's what this issue is about. |
I've brought up the same issue in this ticket: |
@beatfactor this issue has become more relevant since the previous comments were posted and the referenced issue #1285 was closed. For example, with current versions of Firefox, geckodriver and Selenium Server, it is impossible to switch focus between windows. This is because Selenium does not translate the JsonWireProtocol "POST /session/:sessionId/window" command into a W3C WebDriver command before passing it to geckodriver. Thus, geckodriver gets a "name" parameter where it expects a "handle" parameter, which causes the request to fail with an error message. See https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidwindow and https://w3c.github.io/webdriver/webdriver-spec.html#switch-to-window for the protocol difference. Most likely, there are also other commands where a translation done by Selenium would be needed but is missing. I have raised the issue SeleniumHQ/selenium#5831 about the missing translation but received the reply that the Selenium project is phasing out the protocol translation. Quote from a comment:
At the same time, it seems that both Crome and Edge have made good progress with implementing the W3C WebDriver API. See: https://docs.microsoft.com/en-us/microsoft-edge/webdriver For Edge, it seems that the missing items from the W3C support are all about things that were either not supported by Edge with JsonWire, not part of the protocol with JsonWire, or take the same parameters in the both protocols and therefore may be largely compatible. It is not as easy to interpret the ChromeDriver list (does empty mean the same thing as "complete", for example?), but a reasonable conclusion from scanning the list is that they either are very close to supporting the same things that they have supported through JsonWire, or already do it. Egde and Chrome might not drop the JsonWireProtocol compatibility any time in the near future, but Firefox driving is already starting to break (or has been broken since the introduction of geckodriver), and moving towards W3C WebDriver communication is now unlikely to break anything with modern browsers and drivers. Therefore, please take the W3C WebDriver issue as a serious feature request, or even better, a bug fix request for Firefox compatibility. |
@OttoG I'm not sure if you're aware, but we have launched a new major version a few days ago which should mitigate some issues regarding compatibility and also make it easier to fix remaining ones. So, at this point, I can assure you that WebDriver compatibility is on the top of our list of priorities. However, we need help from the community, so I encourage you to try out the new version (1.0.3), if you haven't hadn't already - it's on the releases/1.0 branch and also in NPM. I will merge the code to master in the next few days and then I'll also revisit the existing issues and features requests. |
@beatfactor Thank you for the fast reply. I was not aware of the new version, as it is marked as beta in NPM, but with “npm install [email protected]” I could install it. Unfortunately, the switchWindow API call still fails, but now with an exception, which is an improvement over the previous silent failure:
The tcpdump trace of the exchange with Selenium Server still looks the same, with "name" instead of "handle":
Off topic, on the 1.0.3 version in general, I noticed a few changes and an error.
|
@OttoG Thanks for your detailed feedback. I will look into fixing 1 and 3 - 1 is unintentional and 3 is a bug. Regarding 2 - this happens because Chrome still uses JsonWire for the time being, and so you'll still get For switchWindow issues, would you mind opening a separate issue? Thanks. |
@OttoG the issues you have reported should be fixed in v1.0.10. If there are other issues left, could we please address them as separate? Regarding general W3C WebDriver compatibility we are trying to close the gap before the v1.0 stable release and we'll handle remaining inconsistencies separately. |
When creating a new session, geckodriver returns a response like this:
Nightwatch.js can't parse this correctly, so it doesn't work. It fails here: https://github.com/nightwatchjs/nightwatch/blob/v0.9.15/lib/index.js#L475
See mozilla/geckodriver#714 (comment) for more information.
The text was updated successfully, but these errors were encountered: