-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[🐛 Bug]: Grid Protocol Converter Insufficient #10374
Comments
I created a separate project on github for testing grid compatibility: You can easily clone it and run commands described in readme. At the moment this VERY TRIVIAL test shows that all versions of Java bindings (2.x, 3.x, 4.x) do work with all versions of grid (2.x, 3.x, 4.x). |
I updated the ticket with which of the Ruby errors I've verified are also broken in Java. @asolntsev verified interoperability in Java between the versions based on a single test, but I'm hoping we can get the full Selenide test suite from 2.53 to run on Grid 4 to see if anything else is broken. |
@titusfortner Now I added the checks you suggested above
|
Ok, just overhauled the original post with all the data. I think option 1 or 3 are reasonable, but 2 is way more effort than we have resources available right now, and 1 is going to continue to make adding new things challenging. |
@titusfortner I vote for option 3. I am absolutely sure that the backward compatibility of Selenium Grid is not needed at all. When people want to upgrade Selenium, they do upgrade both tests and grid. Period. I don't see absolutely any reasons why someone should need to upgrade only one of them. |
The primary (and legitimate) use case is going to be Selenium 2 users who want to run tests on the latest Firefox or Safari browsers, which are w3c only. Theoretically they don't have to upgrade their code, they can just update the grid (to 3.9+) and have everything still work. In practice I think these users don't care about cross browser testing and are content with having *anything work, and that's either a hard coded older version of Firefox, or the latest Chrome. |
And I made an updated update. Fun story. I was noting some weird differences between Ruby 2.53 and Java 2.53 with Grid 4. Turns out that before we created the handshake approach in 3.0, the bindings were slowly converting JSON Wire Protocol things with W3C implementations. Selenium 2.45.0 was completely JSON Wire Protocol, and starting in 2.46.0 some things were getting changed. The changes were fine because Chrome was the only driver that Selenium wasn't maintaining, and Chrome was quick to update things at that time. Doesn't look like JS did any of this. The protocol conversion code that was added in 3.7 didn't consider the actual original JSON Wire Protocol format, though, just the things that changed after the handshake code. |
Also interesting to look at selenium-java numbers from the past month: W3C users: W3C/JWP Handshake JWP users: |
This is a case where someone was creating a JWP session but sending W3C commands. Ideally, these cases should be rare but get very confusing due to the nature of it. Based on the comments above, I believe option 3 is the way to go. We need to think how to implement it without breaking things. |
To be fair, I'm not sure we should be supporting curl requests directly? If they'd sent the request to the Grid for |
So, we've agreed to only support w3c compliant capabilities starting in Selenium 4.3. As part of figuring out how to throw good warning messages for Selenium 4.2, I came across some really peculiar grid behavior: https://gist.github.com/titusfortner/1956ca0e863b5fa7baff9a61ebbe135b I'm linking it here for additional documentation on why what we have isn't doing what we are expecting it to do. |
…tandard to W3C Standard Fixes SeleniumHQ#10698 as part of SeleniumHQ#10374
…tandard to W3C Standard (#10700) * [Java] Convert RemoteWebElement::getLocation and ::getSize from JWP Standard to W3C Standard Fixes #10698 as part of #10374 * [java] Fixing RemoteWebElementTest unit tests Co-authored-by: Diego Molina <diemol@users.noreply.github.com> Co-authored-by: Diego Molina <diemol@gmail.com> [skip ci]
Does the decision to support only w3c capabilities in Selenium 4.3 effectively mean that Edge IE Mode will not be usable on the grid from 4.3? With 4.2.2 IE warnings are thrown for capabilities like enablePersistentHover, ie.edgepath, ignoreProtectedModeSetting and ie.edgechromium to name a few. |
It will still work. The deprecation notices are much more eager than we realized when we released. |
…tandard to W3C Standard (SeleniumHQ#10700) * [Java] Convert RemoteWebElement::getLocation and ::getSize from JWP Standard to W3C Standard Fixes SeleniumHQ#10698 as part of SeleniumHQ#10374 * [java] Fixing RemoteWebElementTest unit tests Co-authored-by: Diego Molina <diemol@users.noreply.github.com> Co-authored-by: Diego Molina <diemol@gmail.com> [skip ci]
This is more a major effort than something that belongs to a specific milestone |
Hi @titusfortner - I realise this may not be the best place and unrelated to this bug but reached here from your blog post on dropping legacy support. Will the java client deprecate For CBT use-cases, the legacy protocol made it very simple to switch capabilities via a config file, however if the constructor has to keep switching, it adds an additional layer of complexity to structure codebases, and is limited only to the popular browsers. For eg. BrowserStack provides Samsung browsers on our Selenium grid; but there's no straight forward option class for selecting Samsung Browser. Thinking out loud if the clients can also implement a generic Remote implementation for Cloud vendors? |
Ah, yes, for those, you'll need to construct your own Please find us on Slack/IRC to discuss more: https://www.selenium.dev/support/#ChatRoom |
I don't think there's a reason to keep this issue open, we know the status, we made the decision and future work will be done incrementally. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What happened?
Java Bindings and the Grid are maintaining a lot of extra code in order to be backwards compatible with earlier versions of Selenium. Except we don't have any tests to show we've been successful with this. I ran the old Watir-WebDriver tests using the final version of Se2 for the Ruby bindings against the latest Grid, and 40% of them failed.
Updated Update
Found several more issues in Java bindings for OSS code; there are 3 categories:
name
,id
&class name
locators)switchToWindow
&sendKeysToActiveElement
) — broken running Java bindings 2.53.1id
&name
,implicitlyWait
,setScriptTimeout
andswitchToFrame
) — broken running Java bindings 2.45.0 or other bindings 2.53.1This is now looking like a lot more work to fix; and less likely that people are making as much use of the protocol translations as we've thought.
Update
The two things definitely affecting the Java bindings actually look like they might be simple to fixUploaded a repo with 13 failing JWP tests with Grid 4 (and 1 failing JWP test with Server v3 for completeness)
https://github.com/titusfortner/grid4conversion/tree/main/src/test/java/com/titusfortner/grid4conversion
Options
Someone suggested to me that we should proceed with option 3 and if any user really wants option 2, they can pay us/someone to do it, and that makes sense to me with limited resources.
Supporting Data
Here are the different combinations I tested with old watir-webdriver specs using Selenium 2.53.4 Ruby bindings with the latest versions of the browsers and the latest versions Selenium (toggling OSS mode on/off in Se 3/4 for Chrome)
Things that are broken when running Bindings 2.53.x
Translate click actions with bodies into correct actions (e.g.,(This was broken for Selenium Server 3.x but fixed in Grid 4){"button": 2}
)id
orname
to locate a missing element will throw the wrong error (Java & Ruby)class name
to locate an element gives unable to determine locator strategy (Java & Ruby)Things that are broken when running Java Bindings 2.45 (or later for other bindings):
css selector
,xpath
,tag name
,link text
, orpartial link text
values can't be converted to Web Element(Watir doesn't do a whole lot with actions, so it's
likelypossiblea bunch ofmore things are broken in the translation)@asolntsev is going to try to help us out by running the same experiment with old Selenide test suite for Java. That might tell us more about how bad the situation is. It's possible that other bindings will have fewer issues.
My guess though is that our assumption that Selenium 2 Bindings users can use Selenium 3 Server or Selenium 4 Grid is misguided, and that people still using Selenium 2 are using Selenium 2 server, and we would be better off removing the translation code rather than fixing it.
How can we reproduce the issue?
Ruby can be reproduced by running watir-webdriver 0.9.3 watirspecs with selenium-webdriver 2.53.4 setting REMOTE, and updating the server start code.
Java with JUnit 5:
Relevant log output
and
Operating System
MacOS Big Sur
Selenium version
Ruby 2.53.4 & Java 2.45.0 & Java 2.53.1
What are the browser(s) and version(s) where you see this issue?
Chrome, Firefox, Safari
What are the browser driver(s) and version(s) where you see this issue?
Latest
Are you using Selenium Grid?
4.1.2
The text was updated successfully, but these errors were encountered: