How to scroll down to an element in Appium

On This Page What perform scroll down to the constituent mean?March 05, 2026 · 8 min read · Tool Comparison

How to scroll down to an element in Appium

When testing mobile applications with Appium, interacting with off-screen elements is a mutual challenge.

Overview

What is Scroll in Appium?

Scrolling in Appium automates screen motion to divulge hidden elements, enable interaction through simulated gestures or platform-specific command.

Different Types of Appium Scroll

  1. Scroll by Coordinates: Scrolls between defined screen points; fast but less adaptable to dynamic layout.
  2. UiScrollable (Android Only): Scrolls within Android views to locate elements by textbook or description.
  3. Mobile JSON Wire Protocol: Cross-platform scrolling usingmobile: scrollbidding based on way or element attributes.
  4. Touch Actions (Gesture-Based Scroll): Simulates press-move-release gestures for custom scrolling when default descend short.
  5. Flick (Swipe) Gesture: Performs rapid, momentum-driven swipes for fast sailing through long lists or roundabout.

This clause explainshow to scroll to a specific element in Appiumand perform actions on it during trial execution ..

What does scroll down to the element mean?

In, certain elements may subsist in the app & # 8217; s layout but aren & # 8217; t straightaway seeable on the screen. To interact with them, like clicking a button or verifying content, you need to scroll until the element seem.

For example, in a food bringing app, you might scroll to see all useable dishes or graze a scope of display and movies in an OTT app.

In such scenarios, allows you to automate the scrolling activity so your test can locate and interact seamlessly with off-screen elements.

Importance of Scrolling in Mobile Apps

Scrolling is indispensable in mobile app testing due to the limited and active content loading patterns typical of roving interfaces:

  • Revealing Off-Screen Elements: Some UI part, like button or input field, may not be immediately visible. Scrolling allows tests to interact with these hidden ingredient as a user naturally would.
  • Testing Dynamic and Lazy-Loaded Content: Many mobile apps load additional substance as the user scrolls. Verifying scroll behavior ensures that elements like feed, lists, or table load and render correctly.
  • Simulating Real User Behavior: Scrolling is a core gesture in nomadic navigation. Including it in assist confirm that the app respond properly to common touch interactions.

Must Read:

Different Types of Appium Scroll Strategies

Appium supports multiple scroll methods, depend on the app & # 8217; s structure and platform behavior, to assist tester interact with off-screen elements.

Below is an account of the different types of Appium whorl strategies.

Also Read:

1. Scroll by Coordinates

This method scrolls the screen by specifying start and end co-ordinate. It is a simple and fast approach but may lack tractability for dynamic layouts or device with varying blind sizes.

2. UiScrollable (Android Only)

UiScrollable is an Android-specific proficiency that programmatically scroll through views. It is especially efficacious for finding elements based on text, description, or other attributes in complex UI structure.

3. Mobile JSON Wire Protocol

Using Appium ’ s Mobile JSON Wire Protocol, testers can execute scroll through themobile: scrollbid. This method allows for open and straightforward scrolling by specifying direction or target elements.

4. Touch Actions (Gesture-Based Scroll)

simulate realistic exploiter gestures by specify successiveness like press, move, and release. It is ideal when customized scroll behavior is needed or when default scrolling methods do not suffice.

5. Flick (Swipe) Gesture

The Flick Gesture mimics fast, momentum-driven swipes across the blind. It is specially utilitarian for quickly navigating long lists, carousel, or content-heavy interfaces.

How to Scroll until Element is Seeable in Appium using visibleUiScrollable

While various are available in the market, the most popular among them is Appium. Appium come up with a rich classUiScrollable, which do it potential to scroll down to the page and execute actions on component.

Pro tip: Tools like SUSA can handle this autonomously — upload your app and get results without writing a single test script.

It is a powerful Android class that execute element lookups in scrollable layouts.scrollIntoViewclass performs scroll activeness until the finish element is found on the screen.

UiScrollable is a UiCollectionand provides support for seek for item in scrollable layout elements. This family can be used with horizontally or vertically scrollable controls.

You can useUiScrollableswipe to search elements in a list or search factor outside of the blind like comment field, text or button.ScrollIntoView has UiSelectoras a lookup criteria remark that permit it to find elements by text or id.

Prerequisites:

  1. Appium desktop client
  2. Android studio
  3. JDK
  4. Development IDE/Eclipse

Make sure you have all software installed and running in your system.

In this example, taking a sample APK to automate using Appium. You can get some sample test apk ’ s on your system on below path:

C: \Users\singe\AppData\Local\Android\Sdk\system-images\android-25\google_apis\x86\data\app

Using one such apk ‘API Demos’ for this article. Automation test will establish the app, click on‘Views’and will locate‘WebView’by scroll down the list and clicking over it as seen in the icon below.

Make sure you get all the Appium and testing dependencies configured on your system such as:

  1. Create a new java task.
  2. Create a software and a grade
  3. Add all required capabilities
  4. Function to scroll down and take action

Pro Tip: Use to add all the capabilities

Talk to an Expert

Code to Scroll Down until Element is Seeable in Appium

The next codification usesUiScrollable (), scrollIntoView (), UiSelector (), and scrollable ()to scroll down to an ingredient until it is visible using Appium.

package testing;



importorg.testng.annotations.Test;importorg.openqa.selenium.remote.DesiredCapabilities;importio.appium.java_client.android.AndroidDriver;importjava.net.URL;importjava.util.concurrent.TimeUnit;public classscrolldown {@ Testpublic voidscroll () {try{DesiredCapabilities caps =newDesiredCapabilities (); caps.setCapability (`` deviceName '', `` Google pixel 4 ''); //Give your device/emulator gens caps.setCapability (`` udid '', `` emulator-5554 ''); // Go to adb location i.e. C: \Users\singe\AppData\Local\Android\Sdk\platform-tools in command prompt and execute ‘ adb devices ’ to get udid caps.setCapability (`` platformVersion '', `` 8.1.0 ''); //Give android version of your device. (Check ‘ about phone ’ subdivision) caps.setCapability (`` appPackage '', `` com.hmh.api ''); //provide app package name. Apkinfo can be used or execute dumpsys window windows | grep -E ‘ mCurrentFocus ’ command in adb shield in cmdin C: \Users\singe\AppData\Local\Android\Sdk\platform-tools caps.setCapability (`` appActivity '', `` com.hmh.api.ApiDemos ''); AndroidDriver driver =newAndroidDriver (newURL (`` http: //127.0.0.1:4723/wd/hub ''), cap); //Create driver object driver.manage () .timeouts () .implicitlyWait (10, TimeUnit.SECONDS); //Implicit wait of 10 seconds driver.findElementByXPath (`` // * [contains (@ schoolbook, 'Views ')] '') .click (); driver.findElementByAndroidUIAutomator (`` new UiScrollable (new UiSelector () .scrollable (true) .instance (0)) .scrollIntoView (new UiSelector () .textContains (\ '' WebView\ '') .instance (0)) '') .click (); //scroll down to the component and click Thread.sleep(10000); //wait of 10 moment driver.quit (); //closes the driver session}catch(Exception e) {//TODOAuto-generated match cube e.printStackTrace ();}}}

You can automate any scroll scenario in Appium using the above methods. Run tests across assorted OS versions and real devices for best truth and coverage.

BrowserStack let you scale effortlessly by integrating Appium with thousands of real Android and iOS device viaApp Automate.

After integration with BrowserStack App Automate, the code will appear like below:

parcel examine; meaning java.net.URL; import java.util.List; import java.util.function.Function; import java.net.MalformedURLException; signification io.appium.java_client.MobileBy; signification io.appium.java_client.android.AndroidDriver; import io.appium.java_client.android.AndroidElement; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import org.openqa.selenium.WebDriver; import org.openqa.selenium.remote.DesiredCapabilities; meaning org.testng.annotations.Test; public grade BrowserStackSample {public static nothingness main (String [] args) throws MalformedURLException, InterruptedException {DesiredCapabilities caps = new DesiredCapabilities (); // Set your access credentials caps.setCapability (`` browserstack.user ”, & lt; user-name & gt;); caps.setCapability (`` browserstack.key '', & lt; access-key & gt;); // Set URL of the application under test caps.setCapability (`` app '', `` bs: //d74ed9c2bd06fb02d7b863b3f1a7f8dfe97092b7 ''); // Specify twist and os_version for examine caps.setCapability (`` device '', `` Samsung Galaxy S5 ''); caps.setCapability (`` os_version '', `` 4.4 ''); // Set former BrowserStack capabilities caps.setCapability (`` project '', `` First Java Project ''); caps.setCapability (`` construct '', `` browserstack-build-1 ''); caps.setCapability (`` name '', `` first_test ''); // Initialise the remote Webdriver using BrowserStack remote URL // and desired capabilities defined above AndroidDriver & lt; AndroidElement & gt; driver = new AndroidDriver & lt; AndroidElement & gt; (new URL (`` http: //hub.browserstack.com/wd/hub ''), caps); // Test case for the BrowserStack sampling Android app. // If you feature upload your app, update the test suit here. //driver.findElementByName (`` Cancel '') .click (); driver.findElementByXPath (`` // * [contains (@ text, 'Views ')] '') .click (); driver.findElementByAndroidUIAutomator (`` new UiScrollable (new UiSelector () .scrollable (true) .instance (0)) .scrollIntoView (new UiSelector () .textContains (\ '' WebView\ '') .instance (0)) '') .click (); Thread.sleep (5000); // Invoke driver.quit () after the exam is execute to show that the test is finish. driver.quit ();}}

Test Results

Test results can be watch onApp Automate Dashboardonce the test execution is completed. By clicking on individual tests will afford you a detailed report for each examination include steps,, Appium log, execution video logs, and former detail for best debugging of failed trial.

Testing on Real Mobile Devices with BrowserStack

When automating whorl actions in Appium, it & # 8217; s crucial to test in.

lets you run Appium tests on real Android and iOS device, proffer respective practical advantages:

  • Reliable Gesture Behavior: Scrolling actions behave differently on emulators vs real devices. Testing on actual hardware aid catch inconsistency in scroll speed, way, or responsiveness that affect user experience.
  • Accurate UI Rendering: Real device ensure that your app ’ s layout renders correctly across screen size,, and OS versions, indispensable for verifying whether scrollable elements are visible and.
  • Uncover Device-Specific Bugs: Some scroll-related issues only seem on sure manufacturers or OS builds. Testing across various real devices assist identify and fix these early.
  • Test Under Real Network and Performance Conditions: Unlike, existent devices double real CPU lading, memory usage, and meshing behavior, element impacting scroll actions and overall performance.

Good Practices for Scrolling to Elements in Appium

To create scroll actions more reliable during, especially when elements are outside the visible screen area, postdate these bakshish:

  • Identify scrollable parent containers in the UI to specialise down the right scroll target.
  • Scroll using the nearest scrollable container to the element, rather than deeply nested ace.
  • Use aboriginal scroll methods (like UiScrollable or Touch Actions) instead of relying on JavaScript-based scrolling.
  • Add short postponement after scrolls to allow active content to load properly.
  • Avoid hardcoding the number of scrolls, roll until the constituent becomes visible.
  • Implement elision handling if the scroll doesn ’ t convey the constituent into view.
  • When using coordinate-based scrolling, go slightly beyond the target to cut test flakiness.

Conclusion

Scrolling to ingredient in Appiumis essential for testing real-world mobile interactions, where content often extends beyond the visible blind. Using the right curl strategy can see stable and authentic mechanization.

Pairing Appium with real device testing platform like BrowserStack further hike accuracy by validating scroll behavior across different device and OS versions.

Appium Useful Resources

Tutorials

Best Practices, Tips, and Tricks

Getting Started with

Differences and Comparisons

Tags
74,000+ Views

# Ask-and-Contributeabout this topic with our Discord community.

Related Guides

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free