[QA] Firefox doesn't scroll items into view in browser tests
Dan Duvall
dduvall at wikimedia.org
Tue Sep 16 20:37:58 UTC 2014
According to the WebDriver specification, Firefox "SHOULD try to scroll the
element into view." [1] In other words, it's recommended but the FF
webdriver isn't violating the spec when it doesn't.
Take a look at the watir-scroll gem. It essentially does the JS scrolling
that you mentioned (and those SO posts mention) but at least you won't be
reinventing the wheel. [2] And please let us know if it works reliably as
it might be worth including in mediawiki_selenium or at least recommending
in the docs.
[1] http://www.w3.org/TR/webdriver/#methods-2
[2] https://github.com/p0deje/watir-scroll
On Tue, Sep 16, 2014 at 12:58 PM, S Page <spage at wikimedia.org> wrote:
> Flow topics and posts have a dropdown "action menu". Tests that interact
> with the bottom item in the action menu started failing on Firefox because
> it is outside the browser window, so attempts to click it get
>
> "Element is not currently visible and so may not be interacted with"
>
> (bug 70878 [1]).
>
> Other Selenium users have this issue[2], but that StackOverflow has
> comments like
> "Selenium 2 tries to scroll to the element and then click on it" [3]
>
> If I run the test in chromium 37 on my browser and shrink the window,
> chromium scrolls the window to bring the element into view. But Firefox 32
> doesn't seem to scroll at all. I'm running selenium-webdriver 2.43.0
> locally. Is this a known Firefox issue? Must I put JS executeScript(
> scrollIntoView() ) hacks into my support code?
>
> Thanks as always.
>
> [1] https://bugzilla.wikimedia.org/show_bug.cgi?id=70878
> [2]
> http://stackoverflow.com/questions/3401343/scroll-element-into-view-with-selenium
> [3] http://stackoverflow.com/a/3403683/451712 (I commented there as
> "skierpage")
>
> --
> =S Page Features engineer
>
> _______________________________________________
> QA mailing list
> QA at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/qa
>
>
--
Dan Duvall
Automation Engineer
Wikimedia Foundation <http://wikimediafoundation.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.wikimedia.org/pipermail/qa/attachments/20140916/0b0f338e/attachment.html>
More information about the QA
mailing list