# Scroll To Position does not load hidden elements

**URL:** <https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637>\
**Category:** Feature Request\
**Tags:** feature-request, katalon-studio\
**Created:** [December 20, 2017, 1:40pm UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637 "2017-12-20T13:40:15Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anita](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@Anita](https://forum.katalon.com/u/Anita)\
**Post date:** [December 20, 2017, 1:40pm UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637/1 "2017-12-20T13:40:15Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![Zarashima](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/zarashima/32/928_2.png) [@Zarashima](https://forum.katalon.com/u/Zarashima)\
**Post date:** [December 20, 2017, 2:22pm UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637/2 "2017-12-20T14:22:40Z")

</div>

Hi Anita,

Scroll To Position or Scroll To Element will execute javascript (arguments[0].scrollIntoView()) to scroll to its position or defined element. Your current web application does trigger showing hidden elements when using this approach, so I would like to take this issue as an improvement and will move this discussion to Features / Suggestions category instead.

---

<div class="post-metadata">

**Author:** ![Johann](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@Johann](https://forum.katalon.com/u/Johann)\
**Post date:** [February 6, 2018, 8:09am UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637/3 "2018-02-06T08:09:44Z")

</div>

We’re having the same issue. Using lazy loading for the pages; elements will show when the user starts scrolling. In order to verify the presence of the hidden elements, it would be a great advantage if Katalon Studio could simulate this user action.

---

<div class="post-metadata">

**Author:** ![Miguel\_Angel\_Oliver](https://avatars.discourse-cdn.com/v4/letter/m/f07891/32.png) [@Miguel\_Angel\_Oliver](https://forum.katalon.com/u/Miguel_Angel_Oliver)\
**Post date:** [February 6, 2018, 11:43am UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637/4 "2018-02-06T11:43:13Z")

</div>

+1

---

<div class="post-metadata">

**Author:** ![surbhi\_agrawal](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@surbhi\_agrawal](https://forum.katalon.com/u/surbhi_agrawal)\
**Post date:** [June 18, 2018, 6:20am UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637/5 "2018-06-18T06:20:22Z")

</div>

I am facing the same issue…not able to click on the hidden element when expands the list.  
I have tried both scrollToElement() and scrollToPosition() methods.  
Please give the solution for this.

Thank You

---

<div class="post-metadata">

**Author:** ![Lijumon\_SL](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/lijumon_sl/32/23870_2.png) [@Lijumon\_SL](https://forum.katalon.com/u/Lijumon_SL)\
**Post date:** [June 26, 2018, 6:23am UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637/6 "2018-06-26T06:23:32Z")

</div>

I am also facing the same issue with ag-grid, Katalon please provide a solution.

---

<div class="post-metadata">

**Author:** ![Rok\_Lenardic](https://avatars.discourse-cdn.com/v4/letter/r/9de0a6/32.png) [@Rok\_Lenardic](https://forum.katalon.com/u/Rok_Lenardic)\
**Post date:** [July 19, 2018, 1:43pm UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637/7 "2018-07-19T13:43:03Z")

</div>

We are facing the same issue when using a SPA solution that implements a so called “infinite scroll” using devxpress components. I believe this is a very common web solution nowadays so really hoping such a test case can be added to Katalon soon!

---

<div class="post-metadata">

**Author:** ![Julie\_Mortlock](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@Julie\_Mortlock](https://forum.katalon.com/u/Julie_Mortlock)\
**Post date:** [August 10, 2018, 1:17pm UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637/8 "2018-08-10T13:17:04Z")

</div>

I kind of faked it out by scrolling to and element I know is mid page so a lower popup menu to enable clicking on it. It’s a little cheat, but it did the trick. Maybe you can use this until such time a better solution comes along? I also added some delays so I can see what it’s doing.

Manual verson  
 ![](https://s3.amazonaws.com/katalon-forum/editor/wp/z382emailb5l.png "Image: https://s3.amazonaws.com/katalon-forum/editor/wp/z382emailb5l.png")  
Here’s the script version:

'Scrolling down the page so popup appears. ’

WebUI.scrollToElement(findTestObject(‘Homepage PopUp Footer/Page\_Southern New Hampshire Univers/h2\_NewSNHU’), 3)

WebUI.waitForElementVisible(findTestObject(‘Homepage PopUp Footer/Page\_Southern New Hampshire Univers/a\_Apply Now’), 3)

WebUI.click(findTestObject(‘Object Repository/Homepage PopUp Footer/Page\_Southern New Hampshire Univers/a\_Apply Now’))

WebUI.delay(2)

WebUI.click(findTestObject(‘Homepage PopUp Footer/Page\_Southern New Hampshire Univers/a\_fancybox-item fancybox-close’))

WebUI.delay(2)

WebUI.mouseOver(findTestObject(‘Homepage PopUp Footer/Page\_Southern New Hampshire Univers/a\_Visit SNHU’), FailureHandling.STOP\_ON\_FAILURE)

WebUI.click(findTestObject(‘Homepage PopUp Footer/Page\_Southern New Hampshire Univers/a\_Visit SNHU’))

[image.png](https://s3.amazonaws.com/katalon-forum/editor/wp/z382emailb5l.png)

---

<div class="post-metadata">

**Author:** ![Thiago\_Jorge\_Almeida](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thiago_jorge_almeida/32/1078_2.png) [@Thiago\_Jorge\_Almeida](https://forum.katalon.com/u/Thiago_Jorge_Almeida)\
**Post date:** [September 26, 2018, 7:32pm UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637/9 "2018-09-26T19:32:54Z")

</div>

I am also facing the same issue.

---

<div class="post-metadata">

**Author:** ![ThanhTo](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thanhto/32/697_2.png) [@ThanhTo](https://forum.katalon.com/u/ThanhTo)\
**Post date:** [November 5, 2018, 5:21am UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637/10 "2018-11-05T05:21:00Z")

</div>

> 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](https://stackoverflow.com/questions/12293158/page-scroll-up-or-down-in-selenium-webdriver-selenium-2-using-java "Link: https://stackoverflow.com/questions/12293158/page-scroll-up-or-down-in-selenium-webdriver-selenium-2-using-java"). Once we understand the problem clearly we will determine if the improvement should be considered in upcoming releases.

---

<div class="post-metadata">

**Author:** ![YoungNgo](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/youngngo/32/15132_2.png) [@YoungNgo](https://forum.katalon.com/u/YoungNgo)\
**Post date:** [November 5, 2018, 1:13pm UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637/11 "2018-11-05T13:13:21Z")

</div>

This issue has been acknowledged and logged to Github.  
Please follow up its status here: [https://github.com/katalon-studio/katalon-studio/issues/10](https://github.com/katalon-studio/katalon-studio/issues/10)

---

<div class="post-metadata">

**Author:** ![Anita](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@Anita](https://forum.katalon.com/u/Anita)\
**Post date:** [November 7, 2018, 1:55pm UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637/12 "2018-11-07T13:55:05Z")

</div>

> 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](https://stackoverflow.com/questions/12293158/page-scroll-up-or-down-in-selenium-webdriver-selenium-2-using-java "Link: https://stackoverflow.com/questions/12293158/page-scroll-up-or-down-in-selenium-webdriver-selenium-2-using-java"). 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.

---

<div class="post-metadata">

**Author:** ![ThanhTo](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thanhto/32/697_2.png) [@ThanhTo](https://forum.katalon.com/u/ThanhTo)\
**Post date:** [November 8, 2018, 1:56am UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637/13 "2018-11-08T01:56:38Z")

</div>

> 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](https://stackoverflow.com/questions/12293158/page-scroll-up-or-down-in-selenium-webdriver-selenium-2-using-java). 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 !

---

<div class="post-metadata">

**Author:** ![mujahed.abuabdo](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/mujahed.abuabdo/32/1007_2.png) [@mujahed.abuabdo](https://forum.katalon.com/u/mujahed.abuabdo)\
**Post date:** [February 21, 2019, 9:18am UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637/14 "2019-02-21T09:18:58Z")

</div>

Hello all,

I faced this because development team using Lazy loading , so not all elements are loaded once the page is opened .  
so you need to scroll until element present to verify a hidden element “Not loaded yet”.

I implemented following solution ,

1- you need to use Custom Keywords .  
2- import following Java Libraries :

- import java.awt.Robot;

- import java.awt.event.InputEvent;  
3- Create Scroll Until element present Method as below :  
@Keyword  
def ScrollUntilElementPresent(String ObjectRepositoryPath) {

4 - Now back to your script and use above method as below :  
CustomKeywords.‘Shahid.ScrollUntilElementPresent’(‘Categories/Movies/Main Movies Page/firstMovieBundle’)

5- Now you have your own ScrollUntilElementPresent Method .  
Hopes this will help .

---

<div class="post-metadata">

**Author:** ![vien.dat](https://avatars.discourse-cdn.com/v4/letter/v/3ec8ea/32.png) [@vien.dat](https://forum.katalon.com/u/vien.dat)\
**Post date:** [January 10, 2020, 7:42am UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637/16 "2020-01-10T07:42:22Z")

</div>

Thank for you help, i can scroll down success.  
But now i have problem to scroll up.  
Can you help my, pls?

---

<div class="post-metadata">

**Author:** ![ThanhTo](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thanhto/32/697_2.png) [@ThanhTo](https://forum.katalon.com/u/ThanhTo)\
**Post date:** [January 10, 2020, 3:41pm UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637/17 "2020-01-10T15:41:02Z")

</div>

Hi @vien.dat

Instead of

```auto
robot.mouseWheel(8)

```

Try

```auto
robot.mouseWheel(-8)

```

You’d probably also need to change the condition. If you’re scrolling up from where you previously scrolled down, then you would need to change the condition to checking if the element on the top of the page is visible with `WebUI.verifyElementVisible`

---

<div class="post-metadata">

**Author:** ![vien.dat](https://avatars.discourse-cdn.com/v4/letter/v/3ec8ea/32.png) [@vien.dat](https://forum.katalon.com/u/vien.dat)\
**Post date:** [January 11, 2020, 8:37am UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637/18 "2020-01-11T08:37:24Z")

</div>

Thank you so much, i will try it.

---

<div class="post-metadata">

**Author:** ![Jass](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/jass/32/9588_2.png) [@Jass](https://forum.katalon.com/u/Jass)\
**Post date:** [March 2, 2020, 4:34am UTC](https://forum.katalon.com/t/scroll-to-position-does-not-load-hidden-elements/8637/19 "2020-03-02T04:34:50Z")

</div>


