SeleniumLibrary icon indicating copy to clipboard operation
SeleniumLibrary copied to clipboard

'Scroll Element Into View' is broken on Firefox

Open Brownies opened this issue 2 years ago • 5 comments

Steps to reproduce the issue

  • Open a page in Firefox such that some element is not inside the viewport
  • Try to scroll to the element with 'Scroll Element Into View'

Expected behavior and actual behavior

When I follow those steps, I see... Gist with trace level log output, stack trace and sample .robot and .html files

I was expecting the element to be scrolled into view. This does work on Chromium, both headless and normal.

Environment

Browser: Firefox 103.0 Browser driver: geckodriver 0.31.0 Operating System: Linux, Ubuntu 20.04 Libraries

  • Robot Framework: 5.0
  • Selenium: 4.1.3 / 4.4.3
  • SeleniumLibrary: 6.0.0
  • Interpreter: CPython 3.8.10

Brownies avatar Aug 22 '22 11:08 Brownies

A likely culprit seems to be the keyword itself which uses ActionChains.move_to_element instead of ActionChains.scroll_to_element.

Brownies avatar Aug 22 '22 11:08 Brownies

Is some one following up? When this issue will be released? Once this issue is fixed we can remove the JS in our script

everlighting avatar Oct 15 '22 13:10 everlighting

I'll see if I can fix this and get the acceptance tests running on Firefox too.

Brownies avatar Dec 22 '22 10:12 Brownies

Bad news, switching to ActionChains.scroll_to_element does not fix the problem. It's also present with RF 6 and selenium 4.7.2 with Firefox 108. Maybe this is a Selenium or Geckodriver problem?

Brownies avatar Dec 22 '22 19:12 Brownies

Yeah, this is an ancient Geckodriver issue and they will not fix it until W3C updates the WebDriver spec: https://github.com/mozilla/geckodriver/issues/776#issuecomment-355086173 Might as well close this issue because the problem is not in SeleniumLibrary and judging by the rate of recent commits the spec update is going to take an eternity.

Brownies avatar Dec 27 '22 18:12 Brownies