Scroll Up in web ui katalon

Hello guys, I want to ask about scrollUp, is in katalon we can scroll up to find the element? for example :


in this web I want to click button filter “Paling sesuai” , but the button is to high to reach for automation. I try to use WebUI.scrollToPosition(5, 0) is only to scrollDown.

Thank you!

3 Likes

Have you tried WebUI.scrollToElement ?

1 Like

yes I’ve tried but it doesnt work . the automation can’t scroll up to the top


line 39

2 Likes

Hi @tioagung92, Would something like this help you?
Copy all of the following to a new test case and then run it.

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

WebUI.openBrowser('')
WebUI.navigateToUrl('https://en.wikipedia.org/wiki/Main_Page')

//Scroll to bottom of page
WebUI.delay(3)
WebUI.executeJavaScript('window.scrollTo(0, document.body.scrollHeight);', null)

//Scroll to Top of page
WebUI.delay(3)
WebUI.executeJavaScript('window.scrollTo(0, -document.body.scrollHeight);', null)

//Scroll midway on page
WebUI.delay(3)
WebUI.executeJavaScript('window.scrollTo(0, 1200);', null)

//Scroll to top of page
WebUI.delay(3)
WebUI.executeJavaScript('window.scrollTo(0, 0);', null)

//Scroll to bottom of page
WebUI.delay(3)
WebUI.executeJavaScript('window.scrollTo(0, 999999);', null)
3 Likes

is null need to change or not ?

1 Like

Hi @tioagung92, Did you try the example?
Nothing needs to change.

1 Like

Hi Dave,
i need to top page,
this works.

Thanks

Hi @achmad.hidayat, Glad to hear it…
Can you set this ticket to solved.
Thanks Dave!

Hi @Dave_Evers ,
I’m sorry, I don’t have permission to solve or close this ticket :pray:
I think just @tioagung92 can do

Thanks @Dave_Evers

Hi there,

Thank you very much for your topic. Please note that it may take a little while before a member of our community or from Katalon team responds to you.

Thanks!