Replies: 12 comments
-
I did some research and some developers embbed the scrollintoview into a one-time timeout with setTimeout(callback, x) with x being in one example 0, in the other 50. Might be an idea in general, I already discovered that scrolling takes some time (execution seems not to be 100% syncronously i e executescript coming back after scroll is done and so this might help to avoid waits. |
Beta Was this translation helpful? Give feedback.
-
@dornech, I'm "driving blind" in trying to debug this issue without a reproducible use-case. Can you help me out? Otherwise it may take a while to construct one on my own. Will get back to you as soon as I can... |
Beta Was this translation helpful? Give feedback.
-
Unfortunately the problem occurs in a protected area with sensitive data, I tried my very best to explain it as generally as possible. I can overcome the problem in my case with a movetoelement action chain. This might be an option for others as well. |
Beta Was this translation helpful? Give feedback.
-
@dornech, does the following work on your system? objWebElt.ScrollIntoView enSpeed:=jump_instant |
Beta Was this translation helpful? Give feedback.
-
I've concluded that this thread belongs in Discussions - this is an intrinsic problem with jscript's scrollIntoView when using smooth scrolling... |
Beta Was this translation helpful? Give feedback.
-
Resolved in v5.9 |
Beta Was this translation helpful? Give feedback.
-
Unfortunately it seems to be an neverending story. I still have trouble and scrollIntoView does not work reliably.
|
Beta Was this translation helpful? Give feedback.
-
Sorry you are having problems with this again. I wish I knew more about the reliability issue. I have tested on a number of use cases. In the test_Scroll module, there are several test subs - do those seem to work for you? Are the reliability issues only happening when there is a scroll animation involved? Did you try setting the scroll speed to driver.ScrollIntoView element, enSpeed:=jump_instant
element.ScrollIntoView enSpeed:=jump_instant Thanks for your patience but it is hard for me to debug when I don't have a failing use-case. |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for caring. |
Beta Was this translation helpful? Give feedback.
-
I just wanted to share my experience and provide a workaround in case others have similar issues. |
Beta Was this translation helpful? Give feedback.
-
Ok. One more question - are you using Firefox or Chrome/Edge when ScollIntoView does not work? |
Beta Was this translation helpful? Give feedback.
-
Chrome. Years ago I was primarily working with Firefox but support of the earlier Selenium COM-Wrapper SeleniumBasic forced me to work with Chrome. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Lets assume I have a Webelement down the page I want to scroll to.
For testing/debugging I reference the VBA add-in noth the DLL.
In real code I use findelement for this without object assignment but I omit this here to make it more clear because I think that should not not make the difference here, should it?
objWebElt.ScrollIntoView
-> does not work during regular execution, does only scroll by a few lines horizontally
-> does work in debug mode (stepping with F8)
objWebDriver.ExecuteScript "arguments[0].scrollIntoView({behavior: ""auto"", block: ""start"", inline: ""nearest""})", objWebElt
-> does work (regular execution & debugging/F8-stepping
objWebDriver.ExecuteScript "arguments[0].scrollIntoView()", objWebElt
-> does work (regular execution & debugging/F8-stepping
Strange, isn't it?
Beta Was this translation helpful? Give feedback.
All reactions