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

elementScrollBehavior is ignored when clicking in Firefox #1200

Closed
p0deje opened this Issue Oct 28, 2015 · 1 comment

Comments

Projects
None yet
1 participant
@p0deje
Member

p0deje commented Oct 28, 2015

Currently, elementScrollBehavior is only invoked when getLocationOnceScrolledIntoView is called. The commit adding this capability has also added it for clickElement (see changes), but later when native events were removed from Firefox, this code has just been removed from clickElement (see changes). This makes this capability useless.

I believe this is a bug and would like to fix it, but not sure where exactly Utils.scrollIntoView might be called. So far I came up with this patch:

diff --git a/javascript/firefox-driver/js/wrappedElement.js b/javascript/firefox-driver/js/wrappedElement.js
index 18b4e62..b327417 100644
--- a/javascript/firefox-driver/js/wrappedElement.js
+++ b/javascript/firefox-driver/js/wrappedElement.js
@@ -68,6 +68,11 @@ WebElement.clickElement = function(respond, parameters) {

   var offset = Utils.getClickablePoint(unwrapped);

+  var inViewAfterScroll = Utils.scrollIntoView(
+      unwrapped,
+      (respond.session.elementScrollBehavior == 0),
+      new goog.math.Coordinate(offset.x, offset.y));
+
   Utils.installWindowCloseListener(respond);
   Utils.installClickListener(respond, WebLoadingListener);

At the same time, I feel like this should be used bot.action.click.

@barancev Can you please take a look at this bug?

@p0deje p0deje added the D-firefox label Oct 28, 2015

@p0deje

This comment has been minimized.

Show comment
Hide comment
@p0deje

p0deje Nov 18, 2015

Member

Fixed in 2f4a6d8

Member

p0deje commented Nov 18, 2015

Fixed in 2f4a6d8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment