Table of contents
1.
Introduction 
2.
Scenario
2.1.
Manual Mode
2.2.
Script Mode
3.
Frequently Asked Questions
3.1.
Is Katalon cloud-based?
3.2.
How many types of files can you attach to Katalon?
3.3.
What Database is used for data-driven testing?
3.4.
What are two types of scripting?
3.5.
Which language is best for SaaS?
4.
Conclusion
Last Updated: Mar 27, 2024
Medium

Handling Scroll to Element in Mobile Automation with katalon studio

Author Muskan Sharma
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction 

Hey Readers!!

We all know about the scroll element in mobile applications, and we use this daily.

But have you ever wondered how this scroll-to-text works in Katalon?

In this article, you will learn about this.

Let's begin!!!

Handling Scroll to Element in Mobile Automation with katalon studio

Scenario

In this article, you'll be learning how to scroll down to a particular element in the mobile application and to do this there are two ways to do this: 

  • Manual Mode
  • Script Mode

Let's look at these in detail.

Manual Mode

1. In the section Add, select the Binary Statement.

Manual Mode

2. Click on the Input field. Choose the Variable value type in the Left Expression, then give the variable the name path.

3. In the right Expression, select the value type as binary, then select the value.

Binary Input

4. In the left Expression, select the value type as Method call. Then in the Method call input box, select the following:

Object Type = Class

Object as RunConfiguration

method =getProjectDir() 

5. Choose String as the Value Type for Right Expression and provide the path to the /folder name/apk file name with extension.

6. On the mobile keyword, select Start Application and then click on input. Select Value Type as Variable in the appFile, then Pass the variable name as a path in value.

7. After this, Add Wait For Element Present item.

8. Call Scroll To Text from mobile keyword Call Scroll and pass Views in Value. Then the Scroll To Text accepts the String type parameter.

9. Call the Tap method, passing the Views object from the Object Repository.

10. Click on the Scroll To Text method, then select Tabs as the input.

Manual Mode

Script Mode

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.configuration.RunConfiguration as RunConfiguration
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling

'Path of the Apk File Store in the path variable'
def path = RunConfiguration.getProjectDir() + '/Data Files/ApiDemos.apk'
'Let’s Start the application'
Mobile.startApplication(path, false)
'Wait for the element Present of Heading API Demos'
Mobile.waitForElementPresent(findTestObject('API Demos Objects/heading_API_Demos'), 54)
'Scroll to the Views text'
Mobile.scrollToText('Views', FailureHandling.STOP_ON_FAILURE)
'Tap on the Views'
Mobile.tap(findTestObject('API Demos Objects/text_Views'), 22)
'Scroll to the Tabs text'
Mobile.scrollToText('Tabs', FailureHandling.STOP_ON_FAILURE)

Frequently Asked Questions

Is Katalon cloud-based?

The cloud-hosted Katalon TestCloud system offers on-demand, adaptable, and secure multi-browser testing environments.

How many types of files can you attach to Katalon?

We can upload any File with Katalon.

What Database is used for data-driven testing?

Databases like data pools, DAO objects, and ADO objects are used for data-driven testing.

What are two types of scripting?

Languages for scripting might be either client-side or server-side.

Which language is best for SaaS?

Ruby is a language that is for SaaS. It is a flexible, portable language primarily used to create desktop SaaS application

Conclusion

This blog has extensively discussed Handling Scroll to Element in Mobile Automation with katalon studio and how to use this.

If you want to learn more deeply, check out the excellent content on the Coding Ninjas Website:

How to handle Drop-down menu with katalon studio 

Handling Web element locators using Katalon Studio 

How to Handle Alerts with katalon studio

Refer to our guided paths on the Coding Ninjas Studio platform to learn more about DSA, DBMS, Competitive Programming, Python, Java, JavaScript, etc. 

Refer to the links problemstop 100 SQL problemsresources, and mock tests to enhance your knowledge.

For placement preparations, visit interview experiences and interview bundle.

Thank You

Do upvote our blog to help other ninjas grow. Happy Coding!

Live masterclass