-
-
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
Selenium 4: Ruby bindings #6444
Conversation
6a02b11
to
7f36a17
Compare
This all sounds fine to me other than the deprecating of the Selenium::WebDriver namespace - that's going to make exception handling while supporting selenium-webdriver 3 and 4 in Capybara a pain |
Fair enough. We might just not do that or find a way to make it work for Capybara painlessly. @titusfortner proposed this, so maybe he has an opinion on that. |
It will be removed in Selenium 4. Use PortProber.above(port) instead. Related to #6444
cbd9785
to
ddeb4bb
Compare
0f1522a
to
e5734e0
Compare
6c6b00d
to
b1a8627
Compare
@p0deje for when you move / CP the commits into here I've tackled the following.
|
d228f6f
to
7e91f8b
Compare
31cd801
to
6b67335
Compare
This commit marks the end of old JSON Wire Protocol dialect support. It is replaced by W3C dialect described by WebDriver specification. We used to support both dialects by figuring out which one to use dynamically (so-called "protocol handshake"), but Selenium 4 only supports W3C specification. Things mostly work fine, though bugs are expected at the edges since this commit includes major changes. Please note that certain drivers don't properly support W3C yet. The current state is the following: * Firefox works fine via GeckoDriver * Chrome works (mostly) fine via ChromeDriver with W3C mode turned on * IE works fine via IEDriverServer * Safari works fine via SafariDriver * Edge doesn't work since it responds with OSS dialect * PhantomJS doesn't work since it has always spoken only OSS dialect * Remote equivalents, when used via Selenium server, work similarly to the described above. OSS dialect: https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol. W3C dialect: https://w3c.github.io/webdriver.
It has been deprecated since Selenium 3.6 and is not W3C specification compliant.
Selenium 4 only supports W3C dialect, so legacy Firefox driver should be gone.
This commit is a part of a broader initiative to remove OSS dialect. In theory, all the drivers will comply to W3C WebDriver specification and support the implementation.
As a part of initiative to remove OSS dialect and support only W3C, all the errors not compliant to specification were removed. It seems like server/grid passes through all the errors from drivers without altering them (with the only exception of custom error when trying to upload multiple files to server using POST /se/file - it's handled just fine by Ruby bindings).
This was only directly called in the HasTouchScreen DriverExtension in 1 instantiation; and as such isn't used that much across the suite Integration tests that relied on Double Forms of this class have just been modified to use the string representation Signed-off-by: Alex Rodionov <[email protected]>
…s of chromedriver Signed-off-by: Alex Rodionov <[email protected]>
This is now in master, so no need to maintain PR. |
This PR is opened for the list of changes I'd like to do for Ruby bindings in Selenium 4. Please read below for details and I'll be happy to hear the feedback. Let's have this PR both as To Do list and discussion board + code of what we want to see in Selenium 4. I'll be updating the list throughout the implementation and discussion.
I'll be very happy to hear the feedback from everyone else involved in selenium-webdriver gem development (@titusfortner, @lmtierney, @twalpole). If something is not clear or doesn't make any sense or causes trouble for higher-level libraries (Watir, Capybara) - let's discuss here.
Removal of OSS dialect
Mouse
class.Keyboard
class.W3CSometimg
classes toSomething
. Remove their OSS equivalents.desired_capabilities
tocapabilities
and provide W3C-compliant API for setting then (alwaysMatch
,firstMatch
).Cleanup
Improvements
Safari::Options
(added in 96998d9).Edge::Options
(added in 4b0296f).Options
classes to remote instances (added in 92f4ed8).Service
instances to driver in favor ofdriver_opts
. Deprecatedriver_opts
.UseThis is postponed until Se5.element/{element id}/attribute/{name}
to get element instead of atom (confirm with Simon).Ruby-specific
DeprecateAgree not to do this.Selenium::WebDriver
namespace in favor ofSelenium
.C-rb
issues (somehow).C-rb
pull requests (somehow).SocketPoller#listening?
as the bug it works around has been fixed in JRuby 1.6.7 (http://jruby.org/2012/02/22/jruby-1-6-7).RUBY_ENGINE
as it was only undefined in MRI 1.8 (also search for similar constants).Platform#null_device
asFile::NULL
was introduced in Ruby 1.9.3 (https://svn.ruby-lang.org/repos/ruby/tags/v1_9_3_0/NEWS).$PROGRAM_NAME == __FILE__
- use IRB instead.File::ALT_SEPARATOR
whenever possible.Logger
.PortProber.random
as it should be avoided (deprecated in 6d3edb5).Wait
to useProcess::CLOCK_MONOTONIC
instead ofTime
as the latter is often monkey-patched (e.g. Timecop).Deprecate and extract all custom HTTP clients (curb/persistent)Postponed.&.
)Safari::Service#binary_path
This change is