Scroll To Position does not load hidden elements

Anita said:

Thanh To said:

Anita said:

I am using Chrome with version 63.0.3239.84 (Official Build) (64-bit) and Katalon Studio 5.2.0.1 on Win 10 Pro (64-bit).
I am testing web page which has a lot of elements.
Elements which are in the visible part of the window are loaded at once, others are hidden and are loaded with the mouse scroll down. I am using Scroll to Position to scroll down but the hidden elements are not shown. I also used Scroll to Element to the element, which is below the hidden elements, but the hidden elements are not shown.
(I tested the same web page with Nightwatch using window.scrollBy() and it shows hidden elements, so the issue is in the Katalon Studio Scroll functions).

Hi Anita. Can you give an example AUT where this issue presents ? We are investigating this and I am wondering if your hidden elements, before being scrolled to, are already present on the page, or simply pop into existence.

Since the keyword ScrollToPosition merely emulates scrolling some amount of offsets, it is AUT-dependent whether or not such an action reveals hidden elements. I haven’t tried the aforementioned Nightwatch window.scrollBy() yet, but I think you can accomplish that by this answer. Once we understand the problem clearly we will determine if the improvement should be considered in upcoming releases.

Hi,

the hidden elements are not present on the page, they pop into existence when you scroll to the bottom of the page.
Currently, we are using next workaround

for (def j : (1..20)) {

    WebUI.sendKeys(findTestObject(null), Keys.chord(Keys.PAGE_DOWN))

}  

which loads the hidden elements and works fine for us.

Hi Anita.

I see why ScrollToElement doesn’t work because there’s no element present yet to scroll to, but I tested ScrollToPosition on AirBnB which only loads elements as users scroll down too - seems to be similar to your AUT, and it works fine, as in it successfully loads element as the page moves down.

ScrollToPosition will execute Javascript: window.scrollTo(x,y) where x,y are the desired coordinates. Could you test it with a coordinates far down enough to see if it could accomplish the same thing as your workaround ? It’d be best if you could provide us with a GIF or a video to reproduce this issue.

Thanks a lot !