Skip to content

elementScrollBehavior is ignored when clicking in Firefox #1200

@p0deje

Description

@p0deje

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions