Hi all my use case is : to find if certain element is visible if we scroll down the page , I used execute Java script to scroll to the bottom of the page , but instead going to the bottom the scroller stops at the middle of the page and says element not found , I used scroll element to view but it says the element cannot be scrolled to view , the only spl feature in my we application is that it uses lazy loading and loads certain elements only when the user scrolls down and the page loading is asynchronous .
Can you please tell us what JS command you where using to scroll down?
And if you are doing lazy loading on that page, bottom is only bottom when you are at the top.
once you are at the bottom, it loads new stuff and now your position is not bottom anymore.
You may want to do a for loop that Scolls a page down, checks if an element is visible and if not scrolls again one page down.
You do that as often as needed until you element gets visible or until the scollHeight is not changing anymore.
Hi Rene , Sorry for late reply I tried using :
Execute JavaScript window.scrollTo(0,3000)
Execute JavaScript window.scrollBy(0,4000)
Execute JavaScript window.scrollTo(0, document.body.scrollHeight)
but the page doesnot scrolls to the bottom , i want to verify things on footer
later i found we had some lazy loading things on web application that might interfere here.
I’ve been experiencing this before wherein I can’t scroll down using Execute javascript KW. In order to be successful, I’m using a Scroll Element Into View KW and it works!