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?
Currently,
elementScrollBehavioris only invoked whengetLocationOnceScrolledIntoViewis called. The commit adding this capability has also added it forclickElement(see changes), but later when native events were removed from Firefox, this code has just been removed fromclickElement(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.scrollIntoViewmight be called. So far I came up with this patch:At the same time, I feel like this should be used
bot.action.click.@barancev Can you please take a look at this bug?