How do I scroll to the bottom of the page in mobile testing?

Hi all,

I’m a newcomer doing the Android mobile testing and I’m stuck in a situation where I have to scroll in the application to click on the desired object item.

The object will be pop up after reach the bottom of the page and before it the object its not visible.

I tried to using swipe but it took 10 times to reach the bottom of the page and I decided not to using swipe cause its not effective I thought.

2 Likes

Use the MobileBuiltInKeywords class

The MobileBuiltInKeywords class provides a number of keywords for interacting with mobile devices, including the scrollToBottom() keyword.

To scroll to the bottom of a page using the scrollToBottom() keyword, follow these steps:

Import the MobileBuiltInKeywords class:
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords

Create a new instance of the MobileBuiltInKeywords class:

MobileBuiltInKeywords mobileBuiltInKeywords = new MobileBuiltInKeywords()

Call the scrollToBottom() keyword:

mobileBuiltInKeywords.scrollToBottom()

OR

Add the below to your script

new groovy.script.GroovyShell().evaluate(
“”"
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords

MobileBuiltInKeywords mobileBuiltInKeywords = new MobileBuiltInKeywords()

mobileBuiltInKeywords.scrollToBottom()
“”"
)

Let us know if it solves your problem

2 Likes