-
Notifications
You must be signed in to change notification settings - Fork 163
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
Improve compatibility with GeckoDriver when using Selenium 3 #255
Conversation
moveto is not part of the W3C Webdriver spec, and so GeckoDriver does not implement it. Our click() implementation uses it to ensure that the element is scrolled into the viewport before clicking on it, due to Selenium requirements. Instead of forbidding the click entirely when using Geckodriver, this now attempts the click directly when moving is unsupported, hoping that the driver has not implemented the restriction when they don't have a way to force the move yet.
Maybe we should do JS scrolling if |
@aik099 failing tests are not related to the element being clicked out of view, but to other unimplemented APIs:
For the non-W3C APIs, we have to wait a bit for now, as replacement for the Selenium low-level (and badly documented) APIs we are using has been discussed only recently in the W3C WebDriver spec, and Firefox has not yet implemented this part. |
Yes, I know. But if somebody is to run these tests locally on a driver, that doesn't implement |
@aik099 the W3C Webdriver spec says that
The only thing I would do here is adding a test in the driver testsuite with a huge Lorem ipsum text and a link below it, so that the link is out of view for almost all screen sizes, to ensure that we can click on it through Mink.
GeckoDriver is such a driver (as it implements the W3C protocol). And clicking works in it with this patch. This is why 35 tests changed status with this patch (33 from error to passing, and 2 form error to failing) |
Then why |
@aik099 Selenium 2.x is about the Selenium protocol, not the W3C protocol (Selenium 2 was written years before the standardization effort started at the W3C). and in the Selenium version of the protocol, moving into the view is not implied by |
I see now. I wasn't aware, that |
@aik099 to be clear, Selenium 3 can run in both Selenium and W3C mode depending on the driver being used. The ChromeDriver is still in Selenium mode for instance |
@stof and @aik099 Hi. I'm blocked in a project that uses this library after an upgrade to Selenium 3 due to this issue with moveto in GeckoDriver. I would be very happy if this PR could be accepted - from reading the conversation it sounds like all that's still possibly required would be the test that stof suggests above? Would it be possible to accept this PR without that test? If not, I'd be happy to develop the test myself if that would help get the wheels turning on this issue. |
moveto is not part of the W3C Webdriver spec, and so GeckoDriver does not implement it.
Our click() implementation uses it to ensure that the element is scrolled into the viewport before clicking on it, due to Selenium requirements.
Instead of forbidding the click entirely when using Geckodriver, this now attempts the click directly when moving is unsupported, hoping that the driver has not implemented the restriction when they don't have a way to force the move yet.
Refs #254
Other methods using
moveto
are not changed like this as they rely on the cursor position too (when using other non-standardized APIs).Before:
Tests: 171, Assertions: 300, Errors: 46, Failures: 4, Skipped: 14.
After:
Tests: 172, Assertions: 375, Errors: 11, Failures: 6, Skipped: 13.
(and one of the failures and one of the errors are the one from #239)