# UiScrollable

Summary:[Inherited Constants](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#inhconstants)\|[Ctors](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#pubctors)\|[Methods](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#pubmethods)\|[Protected Methods](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#promethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#)  

# UiScrollable

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public


class
UiScrollable
`  
`


``


``

extends `[UiCollection](https://developer.android.com/reference/android/support/test/uiautomator/UiCollection)`


``


`

|---|---|---|-----------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||
| ↳ | [android.support.test.uiautomator.UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject) |||
|   | ↳ | [android.support.test.uiautomator.UiCollection](https://developer.android.com/reference/android/support/test/uiautomator/UiCollection) ||
|   |   | ↳ | android.support.test.uiautomator.UiScrollable |

<br />

*** ** * ** ***

UiScrollable is a[UiCollection](https://developer.android.com/reference/android/support/test/uiautomator/UiCollection)and provides support for searching for items in scrollable layout elements. This class can be used with horizontally or vertically scrollable controls.

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#)From class` `[android.support.test.uiautomator.UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)` ` |--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `int`  | [FINGER_TOUCH_HALF_WIDTH](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#FINGER_TOUCH_HALF_WIDTH) <br />                                                                                                                                                                                           | | `int`  | [SWIPE_MARGIN_LIMIT](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#SWIPE_MARGIN_LIMIT) <br />                                                                                                                                                                                                     | | `long` | [WAIT_FOR_EVENT_TMEOUT](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#WAIT_FOR_EVENT_TMEOUT) *This constant is deprecated. use[setScrollAcknowledgmentTimeout(long)](https://developer.android.com/reference/android/support/test/uiautomator/Configurator#setScrollAcknowledgmentTimeout(long))* | | `long` | [WAIT_FOR_SELECTOR_POLL](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#WAIT_FOR_SELECTOR_POLL) <br />                                                                                                                                                                                             | | `long` | [WAIT_FOR_SELECTOR_TIMEOUT](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#WAIT_FOR_SELECTOR_TIMEOUT) *This constant is deprecated. use[setWaitForSelectorTimeout(long)](https://developer.android.com/reference/android/support/test/uiautomator/Configurator#setWaitForSelectorTimeout(long))*   | | `long` | [WAIT_FOR_WINDOW_TMEOUT](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#WAIT_FOR_WINDOW_TMEOUT) <br />                                                                                                                                                                                             | |

|                                                                                                                                       ### Public constructors                                                                                                                                        ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[UiScrollable](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#UiScrollable(android.support.test.uiautomator.UiSelector))`(`[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)` container) ` Constructor. |

|                                                                                                                                                                                                                                                                                                     ### Public methods                                                                                                                                                                                                                                                                                                      ||
|----------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` boolean`                                                                                               | ` `[flingBackward](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#flingBackward())`() ` Performs a backwards fling action with the default number of fling steps (5).                                                                                                                                                                                                                                                                                                      |
| ` boolean`                                                                                               | ` `[flingForward](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#flingForward())`() ` Performs a forward fling with the default number of fling steps (5).                                                                                                                                                                                                                                                                                                                 |
| ` boolean`                                                                                               | ` `[flingToBeginning](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#flingToBeginning(int))`(int maxSwipes) ` Performs a fling gesture to reach the beginning of a scrollable layout element.                                                                                                                                                                                                                                                                              |
| ` boolean`                                                                                               | ` `[flingToEnd](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#flingToEnd(int))`(int maxSwipes) ` Performs a fling gesture to reach the end of a scrollable layout element.                                                                                                                                                                                                                                                                                                |
| ` `[UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)         | ` `[getChildByDescription](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#getChildByDescription(android.support.test.uiautomator.UiSelector, java.lang.String))`(`[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)` childPattern, `[String](https://developer.android.com/reference/java/lang/String.html)` text) ` Searches for a child element in the present scrollable container.                                     |
| ` `[UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)         | ` `[getChildByDescription](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#getChildByDescription(android.support.test.uiautomator.UiSelector, java.lang.String, boolean))`(`[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)` childPattern, `[String](https://developer.android.com/reference/java/lang/String.html)` text, boolean allowScrollSearch) ` Searches for a child element in the present scrollable container. |
| ` `[UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)         | ` `[getChildByInstance](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#getChildByInstance(android.support.test.uiautomator.UiSelector, int))`(`[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)` childPattern, int instance) ` Searches for a child element in the present scrollable container that matches the selector you provided.                                                                                   |
| ` `[UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)         | ` `[getChildByText](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#getChildByText(android.support.test.uiautomator.UiSelector, java.lang.String, boolean))`(`[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)` childPattern, `[String](https://developer.android.com/reference/java/lang/String.html)` text, boolean allowScrollSearch) ` Searches for a child element in the present scrollable container.               |
| ` `[UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)         | ` `[getChildByText](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#getChildByText(android.support.test.uiautomator.UiSelector, java.lang.String))`(`[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)` childPattern, `[String](https://developer.android.com/reference/java/lang/String.html)` text) ` Searches for a child element in the present scrollable container.                                                   |
| ` int`                                                                                                   | ` `[getMaxSearchSwipes](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#getMaxSearchSwipes())`() ` Gets the maximum number of scrolls allowed when performing a scroll action in search of a child element.                                                                                                                                                                                                                                                                 |
| ` double`                                                                                                | ` `[getSwipeDeadZonePercentage](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#getSwipeDeadZonePercentage())`() ` Returns the percentage of a widget's size that's considered as a no-touch zone when swiping.                                                                                                                                                                                                                                                             |
| ` boolean`                                                                                               | ` `[scrollBackward](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#scrollBackward(int))`(int steps) ` Performs a backward scroll.                                                                                                                                                                                                                                                                                                                                          |
| ` boolean`                                                                                               | ` `[scrollBackward](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#scrollBackward())`() ` Performs a backward scroll with the default number of scroll steps (55).                                                                                                                                                                                                                                                                                                         |
| ` boolean`                                                                                               | ` `[scrollDescriptionIntoView](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#scrollDescriptionIntoView(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String.html)` text) ` Performs a forward scroll action on the scrollable layout element until the content-description is found, or until swipe attempts have been exhausted.                                                                                                       |
| ` boolean`                                                                                               | ` `[scrollForward](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#scrollForward(int))`(int steps) ` Performs a forward scroll.                                                                                                                                                                                                                                                                                                                                             |
| ` boolean`                                                                                               | ` `[scrollForward](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#scrollForward())`() ` Performs a forward scroll with the default number of scroll steps (55).                                                                                                                                                                                                                                                                                                            |
| ` boolean`                                                                                               | ` `[scrollIntoView](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#scrollIntoView(android.support.test.uiautomator.UiSelector))`(`[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)` selector) ` Perform a scroll forward action to move through the scrollable layout element until a visible item that matches the selector is found.                                                                                    |
| ` boolean`                                                                                               | ` `[scrollIntoView](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#scrollIntoView(android.support.test.uiautomator.UiObject))`(`[UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)` obj) ` Perform a forward scroll action to move through the scrollable layout element until a visible item that matches the[UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)is found.            |
| ` boolean`                                                                                               | ` `[scrollTextIntoView](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#scrollTextIntoView(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String.html)` text) ` Performs a forward scroll action on the scrollable layout element until the text you provided is visible, or until swipe attempts have been exhausted.                                                                                                                     |
| ` boolean`                                                                                               | ` `[scrollToBeginning](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#scrollToBeginning(int))`(int maxSwipes) ` Scrolls to the beginning of a scrollable layout element.                                                                                                                                                                                                                                                                                                   |
| ` boolean`                                                                                               | ` `[scrollToBeginning](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#scrollToBeginning(int, int))`(int maxSwipes, int steps) ` Scrolls to the beginning of a scrollable layout element.                                                                                                                                                                                                                                                                                   |
| ` boolean`                                                                                               | ` `[scrollToEnd](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#scrollToEnd(int))`(int maxSwipes) ` Scrolls to the end of a scrollable layout element.                                                                                                                                                                                                                                                                                                                     |
| ` boolean`                                                                                               | ` `[scrollToEnd](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#scrollToEnd(int, int))`(int maxSwipes, int steps) ` Scrolls to the end of a scrollable layout element.                                                                                                                                                                                                                                                                                                     |
| ` `[UiScrollable](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable) | ` `[setAsHorizontalList](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#setAsHorizontalList())`() ` Set the direction of swipes to be horizontal when performing scroll actions.                                                                                                                                                                                                                                                                                           |
| ` `[UiScrollable](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable) | ` `[setAsVerticalList](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#setAsVerticalList())`() ` Set the direction of swipes to be vertical when performing scroll actions.                                                                                                                                                                                                                                                                                                 |
| ` `[UiScrollable](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable) | ` `[setMaxSearchSwipes](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#setMaxSearchSwipes(int))`(int swipes) ` Sets the maximum number of scrolls allowed when performing a scroll action in search of a child element.                                                                                                                                                                                                                                                    |
| ` `[UiScrollable](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable) | ` `[setSwipeDeadZonePercentage](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#setSwipeDeadZonePercentage(double))`(double swipeDeadZonePercentage) ` Sets the percentage of a widget's size that's considered as no-touch zone when swiping.                                                                                                                                                                                                                              |

|                                                                                                                                                                                ### Protected methods                                                                                                                                                                                 ||
|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` boolean` | ` `[exists](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#exists(android.support.test.uiautomator.UiSelector))`(`[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)` selector) ` Used privately when performing swipe searches to decide if an element has become visible or not. |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#)From class` `[android.support.test.uiautomator.UiCollection](https://developer.android.com/reference/android/support/test/uiautomator/UiCollection)` ` |--------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject) | ` `[getChildByDescription](https://developer.android.com/reference/android/support/test/uiautomator/UiCollection#getChildByDescription(android.support.test.uiautomator.UiSelector, java.lang.String))`(`[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)` childPattern, `[String](https://developer.android.com/reference/java/lang/String.html)` text) ` Searches for child UI element within the constraints of this UiCollection[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)selector. | | ` `[UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject) | ` `[getChildByInstance](https://developer.android.com/reference/android/support/test/uiautomator/UiCollection#getChildByInstance(android.support.test.uiautomator.UiSelector, int))`(`[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)` childPattern, int instance) ` Searches for child UI element within the constraints of this UiCollection[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)selector.                                                                                      | | ` `[UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject) | ` `[getChildByText](https://developer.android.com/reference/android/support/test/uiautomator/UiCollection#getChildByText(android.support.test.uiautomator.UiSelector, java.lang.String))`(`[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)` childPattern, `[String](https://developer.android.com/reference/java/lang/String.html)` text) ` Searches for child UI element within the constraints of this UiCollection[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)selector.               | | ` int`                                                                                           | ` `[getChildCount](https://developer.android.com/reference/android/support/test/uiautomator/UiCollection#getChildCount(android.support.test.uiautomator.UiSelector))`(`[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)` childPattern) ` Counts child UI element instances matching the`childPattern`argument.                                                                                                                                                                                                                                 | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#)From class` `[android.support.test.uiautomator.UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)` ` |---------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` void`                                                                                                                   | ` `[clearTextField](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#clearTextField())`() ` Clears the existing text contents in an editable field.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | ` boolean`                                                                                                                | ` `[click](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#click())`() ` Performs a click at the center of the visible bounds of the UI element represented by this UiObject.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | ` boolean`                                                                                                                | ` `[clickAndWaitForNewWindow](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#clickAndWaitForNewWindow())`() ` Waits for window transitions that would typically take longer than the usual default timeouts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | ` boolean`                                                                                                                | ` `[clickAndWaitForNewWindow](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#clickAndWaitForNewWindow(long))`(long timeout) ` Performs a click at the center of the visible bounds of the UI element represented by this UiObject and waits for window transitions.                                                                                                                                                                                                                                                                                                                                                                                                              | | ` boolean`                                                                                                                | ` `[clickBottomRight](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#clickBottomRight())`() ` Clicks the bottom and right corner of the UI element                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | | ` boolean`                                                                                                                | ` `[clickTopLeft](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#clickTopLeft())`() ` Clicks the top and left corner of the UI element                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | ` boolean`                                                                                                                | ` `[dragTo](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#dragTo(android.support.test.uiautomator.UiObject, int))`(`[UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)` destObj, int steps) ` Drags this object to a destination UiObject.                                                                                                                                                                                                                                                                                                                                                                                           | | ` boolean`                                                                                                                | ` `[dragTo](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#dragTo(int, int, int))`(int destX, int destY, int steps) ` Drags this object to arbitrary coordinates.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | ` boolean`                                                                                                                | ` `[exists](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#exists())`() ` Check if view exists.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | ` `[AccessibilityNodeInfo](https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.html) | ` `[findAccessibilityNodeInfo](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#findAccessibilityNodeInfo(long))`(long timeout) ` Finds a matching UI element in the accessibility hierarchy, by using the selector for this UiObject.                                                                                                                                                                                                                                                                                                                                                                                                                                             | | ` `[Rect](https://developer.android.com/reference/android/graphics/Rect.html)                                             | ` `[getBounds](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#getBounds())`() ` Returns the view's`bounds`property.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | ` `[UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)                          | ` `[getChild](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#getChild(android.support.test.uiautomator.UiSelector))`(`[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)` selector) ` Creates a new UiObject for a child view that is under the present UiObject.                                                                                                                                                                                                                                                                                                                                                                 | | ` int`                                                                                                                    | ` `[getChildCount](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#getChildCount())`() ` Counts the child views immediately under the present UiObject.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | ` `[String](https://developer.android.com/reference/java/lang/String.html)                                                | ` `[getClassName](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#getClassName())`() ` Retrieves the`className`property of the UI element.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | | ` `[String](https://developer.android.com/reference/java/lang/String.html)                                                | ` `[getContentDescription](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#getContentDescription())`() ` Reads the`content_desc`property of the UI element                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | | ` `[UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)                          | ` `[getFromParent](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#getFromParent(android.support.test.uiautomator.UiSelector))`(`[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)` selector) ` Creates a new UiObject for a sibling view or a child of the sibling view, relative to the present UiObject.                                                                                                                                                                                                                                                                                                                       | | ` `[String](https://developer.android.com/reference/java/lang/String.html)                                                | ` `[getPackageName](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#getPackageName())`() ` Reads the view's`package`property                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | ` final `[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)                | ` `[getSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#getSelector())`() ` Debugging helper.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | ` `[String](https://developer.android.com/reference/java/lang/String.html)                                                | ` `[getText](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#getText())`() ` Reads the`text`property of the UI element                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | ` `[Rect](https://developer.android.com/reference/android/graphics/Rect.html)                                             | ` `[getVisibleBounds](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#getVisibleBounds())`() ` Returns the visible bounds of the view.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | ` boolean`                                                                                                                | ` `[isCheckable](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#isCheckable())`() ` Checks if the UI element's`checkable`property is currently true.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | ` boolean`                                                                                                                | ` `[isChecked](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#isChecked())`() ` Check if the UI element's`checked`property is currently true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | ` boolean`                                                                                                                | ` `[isClickable](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#isClickable())`() ` Checks if the UI element's`clickable`property is currently true.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | ` boolean`                                                                                                                | ` `[isEnabled](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#isEnabled())`() ` Checks if the UI element's`enabled`property is currently true.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | ` boolean`                                                                                                                | ` `[isFocusable](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#isFocusable())`() ` Check if the UI element's`focusable`property is currently true.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | ` boolean`                                                                                                                | ` `[isFocused](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#isFocused())`() ` Check if the UI element's`focused`property is currently true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | ` boolean`                                                                                                                | ` `[isLongClickable](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#isLongClickable())`() ` Check if the view's`long-clickable`property is currently true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | | ` boolean`                                                                                                                | ` `[isScrollable](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#isScrollable())`() ` Check if the view's`scrollable`property is currently true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | ` boolean`                                                                                                                | ` `[isSelected](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#isSelected())`() ` Checks if the UI element's`selected`property is currently true.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | ` boolean`                                                                                                                | ` `[longClick](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#longClick())`() ` Long clicks the center of the visible bounds of the UI element                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | ` boolean`                                                                                                                | ` `[longClickBottomRight](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#longClickBottomRight())`() ` Long clicks bottom and right corner of the UI element                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | ` boolean`                                                                                                                | ` `[longClickTopLeft](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#longClickTopLeft())`() ` Long clicks on the top and left corner of the UI element                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | ` boolean`                                                                                                                | ` `[performMultiPointerGesture](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#performMultiPointerGesture(android.view.MotionEvent.PointerCoords[]...))`(`[PointerCoords...](https://developer.android.com/reference/android/view/MotionEvent.PointerCoords.html)` touches) ` Performs a multi-touch gesture.                                                                                                                                                                                                                                                                                                                                                                    | | ` boolean`                                                                                                                | ` `[performTwoPointerGesture](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#performTwoPointerGesture(android.graphics.Point, android.graphics.Point, android.graphics.Point, android.graphics.Point, int))`(`[Point](https://developer.android.com/reference/android/graphics/Point.html)` startPoint1, `[Point](https://developer.android.com/reference/android/graphics/Point.html)` startPoint2, `[Point](https://developer.android.com/reference/android/graphics/Point.html)` endPoint1, `[Point](https://developer.android.com/reference/android/graphics/Point.html)` endPoint2, int steps) ` Generates a two-pointer gesture with arbitrary starting and ending points. | | ` boolean`                                                                                                                | ` `[pinchIn](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#pinchIn(int, int))`(int percent, int steps) ` Performs a two-pointer gesture, where each pointer moves diagonally toward the other, from the edges to the center of this UiObject .                                                                                                                                                                                                                                                                                                                                                                                                                                  | | ` boolean`                                                                                                                | ` `[pinchOut](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#pinchOut(int, int))`(int percent, int steps) ` Performs a two-pointer gesture, where each pointer moves diagonally opposite across the other, from the center out towards the edges of the this UiObject.                                                                                                                                                                                                                                                                                                                                                                                                           | | ` boolean`                                                                                                                | ` `[setText](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#setText(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String.html)` text) ` Sets the text in an editable field, after clearing the field's content.                                                                                                                                                                                                                                                                                                                                                                                                                                | | ` boolean`                                                                                                                | ` `[swipeDown](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#swipeDown(int))`(int steps) ` Performs the swipe down action on the UiObject.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | ` boolean`                                                                                                                | ` `[swipeLeft](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#swipeLeft(int))`(int steps) ` Performs the swipe left action on the UiObject.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | ` boolean`                                                                                                                | ` `[swipeRight](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#swipeRight(int))`(int steps) ` Performs the swipe right action on the UiObject.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | ` boolean`                                                                                                                | ` `[swipeUp](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#swipeUp(int))`(int steps) ` Performs the swipe up action on the UiObject.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | ` boolean`                                                                                                                | ` `[waitForExists](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#waitForExists(long))`(long timeout) ` Waits a specified length of time for a view to become visible.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | ` boolean`                                                                                                                | ` `[waitUntilGone](https://developer.android.com/reference/android/support/test/uiautomator/UiObject#waitUntilGone(long))`(long timeout) ` Waits a specified length of time for a view to become undetectable.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#)From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object.html)` ` |-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object.html)          | ` clone() `                                                                                | | ` boolean`                                                                          | ` equals(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void`                                                                             | ` finalize() `                                                                             | | ` final `[Class](https://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                             | | ` int`                                                                              | ` hashCode() `                                                                             | | ` final void`                                                                       | ` notify() `                                                                               | | ` final void`                                                                       | ` notifyAll() `                                                                            | | ` `[String](https://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                             | | ` final void`                                                                       | ` wait(long arg0, int arg1) `                                                              | | ` final void`                                                                       | ` wait(long arg0) `                                                                        | | ` final void`                                                                       | ` wait() `                                                                                 | ||

## Public constructors

### UiScrollable

```
UiScrollable (UiSelector container)
```

Constructor.

<br />

|                                                                                       Parameters                                                                                        ||
|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `container` | `UiSelector`: a[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)selector to identify the scrollable layout element. <br /> |

## Public methods

### flingBackward

```
boolean flingBackward ()
```

Performs a backwards fling action with the default number of fling steps (5). If the swipe direction is set to vertical, then the swipe will be performed from top to bottom. If the swipe direction is set to horizontal, then the swipes will be performed from left to right. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.

<br />

|                                Returns                                ||
|-----------|------------------------------------------------------------|
| `boolean` | true if scrolled, and false if can't scroll anymore <br /> |

|                                                               Throws                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |   |

### flingForward

```
boolean flingForward ()
```

Performs a forward fling with the default number of fling steps (5). If the swipe direction is set to vertical, then the swipes will be performed from bottom to top. If the swipe direction is set to horizontal, then the swipes will be performed from right to left. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.

<br />

|                              Returns                              ||
|-----------|--------------------------------------------------------|
| `boolean` | true if scrolled, false if can't scroll anymore <br /> |

|                                                               Throws                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |   |

### flingToBeginning

```
boolean flingToBeginning (int maxSwipes)
```

Performs a fling gesture to reach the beginning of a scrollable layout element. The beginning can be at the top-most edge in the case of vertical controls, or the left-most edge for horizontal controls. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.

<br />

|                    Returns                    ||
|-----------|------------------------------------|
| `boolean` | true on scrolled else false <br /> |

|                                                               Throws                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |   |

### flingToEnd

```
boolean flingToEnd (int maxSwipes)
```

Performs a fling gesture to reach the end of a scrollable layout element. The end can be at the bottom-most edge in the case of vertical controls, or the right-most edge for horizontal controls. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.

<br />

|                    Returns                     ||
|-----------|-------------------------------------|
| `boolean` | true on scrolled, else false <br /> |

|                                                               Throws                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |   |

### getChildByDescription

```
UiObject getChildByDescription (UiSelector childPattern, 
                String text)
```

Searches for a child element in the present scrollable container. The search first looks for a child element that matches the selector you provided, then looks for the content-description in its children elements. If both search conditions are fulfilled, the method returns a {@ link UiObject} representing the element matching the selector (not the child element in its subhierarchy containing the content-description). By default, this method performs a scroll search. See[getChildByDescription(UiSelector, String, boolean)](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#getChildByDescription(android.support.test.uiautomator.UiSelector, java.lang.String, boolean))

<br />

|                                                                                   Parameters                                                                                   ||
|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `childPattern` | `UiSelector`:[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)for a child in a scollable layout element <br /> |
| `text`         | `String`: Content-description to find in the children of the`childPattern`match <br />                                                                         |

|                                                                                                                               Returns                                                                                                                                ||
|-----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject) | [UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)representing the child element that matches the search conditions <br /> |

|                                                                           Throws                                                                           ||
|---------------------------------------------------------------------------------------------------------------------------------|---------------------------|
|                                                                                                                                 | UiObjectNotFoundException |
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |                           |

### getChildByDescription

```
UiObject getChildByDescription (UiSelector childPattern, 
                String text, 
                boolean allowScrollSearch)
```

Searches for a child element in the present scrollable container. The search first looks for a child element that matches the selector you provided, then looks for the content-description in its children elements. If both search conditions are fulfilled, the method returns a {@ link UiObject} representing the element matching the selector (not the child element in its subhierarchy containing the content-description).

<br />

|                                                                                     Parameters                                                                                      ||
|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `childPattern`      | `UiSelector`:[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)for a child in a scollable layout element <br /> |
| `text`              | `String`: Content-description to find in the children of the`childPattern`match (may be a partial match) <br />                                                |
| `allowScrollSearch` | `boolean`: set to true if scrolling is allowed <br />                                                                                                          |

|                                                                                                                               Returns                                                                                                                                ||
|-----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject) | [UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)representing the child element that matches the search conditions <br /> |

|                                                                           Throws                                                                           ||
|---------------------------------------------------------------------------------------------------------------------------------|---------------------------|
|                                                                                                                                 | UiObjectNotFoundException |
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |                           |

### getChildByInstance

```
UiObject getChildByInstance (UiSelector childPattern, 
                int instance)
```

Searches for a child element in the present scrollable container that matches the selector you provided. The search is performed without scrolling and only on visible elements.

<br />

|                                                                                   Parameters                                                                                   ||
|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `childPattern` | `UiSelector`:[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)for a child in a scollable layout element <br /> |
| `instance`     | `int`: int number representing the occurance of a`childPattern`match <br />                                                                                    |

|                                                                                                                               Returns                                                                                                                                ||
|-----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject) | [UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)representing the child element that matches the search conditions <br /> |

|                                                               Throws                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |   |

### getChildByText

```
UiObject getChildByText (UiSelector childPattern, 
                String text, 
                boolean allowScrollSearch)
```

Searches for a child element in the present scrollable container. The search first looks for a child element that matches the selector you provided, then looks for the text in its children elements. If both search conditions are fulfilled, the method returns a {@ link UiObject} representing the element matching the selector (not the child element in its subhierarchy containing the text).

<br />

|                                                                                          Parameters                                                                                           ||
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `childPattern`      | `UiSelector`:[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)selector for a child in a scrollable layout element <br /> |
| `text`              | `String`: String to find in the children of the`childPattern`match <br />                                                                                                |
| `allowScrollSearch` | `boolean`: set to true if scrolling is allowed <br />                                                                                                                    |

|                                                                                                                               Returns                                                                                                                                ||
|-----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject) | [UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)representing the child element that matches the search conditions <br /> |

|                                                                           Throws                                                                           ||
|---------------------------------------------------------------------------------------------------------------------------------|---------------------------|
|                                                                                                                                 | UiObjectNotFoundException |
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |                           |

### getChildByText

```
UiObject getChildByText (UiSelector childPattern, 
                String text)
```

Searches for a child element in the present scrollable container. The search first looks for a child element that matches the selector you provided, then looks for the text in its children elements. If both search conditions are fulfilled, the method returns a {@ link UiObject} representing the element matching the selector (not the child element in its subhierarchy containing the text). By default, this method performs a scroll search. See[getChildByText(UiSelector, String, boolean)](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#getChildByText(android.support.test.uiautomator.UiSelector, java.lang.String, boolean))

<br />

|                                                                                        Parameters                                                                                        ||
|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `childPattern` | `UiSelector`:[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)selector for a child in a scrollable layout element <br /> |
| `text`         | `String`: String to find in the children of the`childPattern`match <br />                                                                                                |

|                                                                                                                               Returns                                                                                                                                ||
|-----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject) | [UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)representing the child element that matches the search conditions <br /> |

|                                                                           Throws                                                                           ||
|---------------------------------------------------------------------------------------------------------------------------------|---------------------------|
|                                                                                                                                 | UiObjectNotFoundException |
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |                           |

### getMaxSearchSwipes

```
int getMaxSearchSwipes ()
```

Gets the maximum number of scrolls allowed when performing a scroll action in search of a child element. See[getChildByDescription(UiSelector, String)](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#getChildByDescription(android.support.test.uiautomator.UiSelector, java.lang.String))and[getChildByText(UiSelector, String)](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#getChildByText(android.support.test.uiautomator.UiSelector, java.lang.String)).

<br />

|                                 Returns                                  ||
|-------|-------------------------------------------------------------------|
| `int` | max the number of search swipes to perform until giving up <br /> |

### getSwipeDeadZonePercentage

```
double getSwipeDeadZonePercentage ()
```

Returns the percentage of a widget's size that's considered as a no-touch zone when swiping. The no-touch zone is set as a percentage of a widget's total width or height, denoting a margin around the swipable area of the widget. Swipes must start and end inside this margin. This is important when the widget being swiped may not respond to the swipe if started at a point too near to the edge. The default is 10% from either edge.

<br />

|                 Returns                  ||
|----------|--------------------------------|
| `double` | a value between 0 and 1 <br /> |

### scrollBackward

```
boolean scrollBackward (int steps)
```

Performs a backward scroll. If the swipe direction is set to vertical, then the swipes will be performed from top to bottom. If the swipe direction is set to horizontal, then the swipes will be performed from left to right. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.

<br />

|                                         Parameters                                          ||
|---------|------------------------------------------------------------------------------------|
| `steps` | `int`: number of steps. Use this to control the speed of the scroll action. <br /> |

|                              Returns                              ||
|-----------|--------------------------------------------------------|
| `boolean` | true if scrolled, false if can't scroll anymore <br /> |

|                                                               Throws                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |   |

### scrollBackward

```
boolean scrollBackward ()
```

Performs a backward scroll with the default number of scroll steps (55). If the swipe direction is set to vertical, then the swipes will be performed from top to bottom. If the swipe direction is set to horizontal, then the swipes will be performed from left to right. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.

<br />

|                                Returns                                ||
|-----------|------------------------------------------------------------|
| `boolean` | true if scrolled, and false if can't scroll anymore <br /> |

|                                                               Throws                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |   |

### scrollDescriptionIntoView

```
boolean scrollDescriptionIntoView (String text)
```

Performs a forward scroll action on the scrollable layout element until the content-description is found, or until swipe attempts have been exhausted. See[setMaxSearchSwipes(int)](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#setMaxSearchSwipes(int))

<br />

|                                                 Parameters                                                  ||
|--------|-----------------------------------------------------------------------------------------------------|
| `text` | `String`: content-description to find within the contents of this scrollable layout element. <br /> |

|                       Returns                        ||
|-----------|-------------------------------------------|
| `boolean` | true if item is found; else, false <br /> |

|                                                               Throws                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |   |

### scrollForward

```
boolean scrollForward (int steps)
```

Performs a forward scroll. If the swipe direction is set to vertical, then the swipes will be performed from bottom to top. If the swipe direction is set to horizontal, then the swipes will be performed from right to left. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.

<br />

|                                         Parameters                                         ||
|---------|-----------------------------------------------------------------------------------|
| `steps` | `int`: number of steps. Use this to control the speed of the scroll action <br /> |

|                              Returns                              ||
|-----------|--------------------------------------------------------|
| `boolean` | true if scrolled, false if can't scroll anymore <br /> |

|                                                               Throws                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |   |

### scrollForward

```
boolean scrollForward ()
```

Performs a forward scroll with the default number of scroll steps (55). If the swipe direction is set to vertical, then the swipes will be performed from bottom to top. If the swipe direction is set to horizontal, then the swipes will be performed from right to left. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.

<br />

|                              Returns                              ||
|-----------|--------------------------------------------------------|
| `boolean` | true if scrolled, false if can't scroll anymore <br /> |

|                                                               Throws                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |   |

### scrollIntoView

```
boolean scrollIntoView (UiSelector selector)
```

Perform a scroll forward action to move through the scrollable layout element until a visible item that matches the selector is found. See[scrollDescriptionIntoView(String)](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#scrollDescriptionIntoView(java.lang.String))and[scrollTextIntoView(String)](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#scrollTextIntoView(java.lang.String)).

<br />

|                                                                Parameters                                                                 ||
|------------|-------------------------------------------------------------------------------------------------------------------------------|
| `selector` | `UiSelector`:[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)selector <br /> |

|                                   Returns                                    ||
|-----------|-------------------------------------------------------------------|
| `boolean` | true if the item was found and now is in view; else, false <br /> |

|                                                               Throws                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |   |

### scrollIntoView

```
boolean scrollIntoView (UiObject obj)
```

Perform a forward scroll action to move through the scrollable layout element until a visible item that matches the[UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)is found.

<br />

|                                                       Parameters                                                       ||
|-------|-----------------------------------------------------------------------------------------------------------------|
| `obj` | `UiObject`:[UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject) <br /> |

|                                  Returns                                   ||
|-----------|-----------------------------------------------------------------|
| `boolean` | true if the item was found and now is in view else false <br /> |

|                                                               Throws                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |   |

### scrollTextIntoView

```
boolean scrollTextIntoView (String text)
```

Performs a forward scroll action on the scrollable layout element until the text you provided is visible, or until swipe attempts have been exhausted. See[setMaxSearchSwipes(int)](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#setMaxSearchSwipes(int))

<br />

|                Parameters                 ||
|--------|-----------------------------------|
| `text` | `String`: test to look for <br /> |

|                       Returns                        ||
|-----------|-------------------------------------------|
| `boolean` | true if item is found; else, false <br /> |

|                                                               Throws                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |   |

### scrollToBeginning

```
boolean scrollToBeginning (int maxSwipes)
```

Scrolls to the beginning of a scrollable layout element. The beginning can be at the top-most edge in the case of vertical controls, or the left-most edge for horizontal controls. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.

<br />

|                    Returns                    ||
|-----------|------------------------------------|
| `boolean` | true on scrolled else false <br /> |

|                                                               Throws                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |   |

### scrollToBeginning

```
boolean scrollToBeginning (int maxSwipes, 
                int steps)
```

Scrolls to the beginning of a scrollable layout element. The beginning can be at the top-most edge in the case of vertical controls, or the left-most edge for horizontal controls. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.

<br />

|                                           Parameters                                            ||
|-------------|------------------------------------------------------------------------------------|
| `maxSwipes` | `int` <br />                                                                       |
| `steps`     | `int`: use steps to control the speed, so that it may be a scroll, or fling <br /> |

|                    Returns                    ||
|-----------|------------------------------------|
| `boolean` | true on scrolled else false <br /> |

|                                                               Throws                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |   |

### scrollToEnd

```
boolean scrollToEnd (int maxSwipes)
```

Scrolls to the end of a scrollable layout element. The end can be at the bottom-most edge in the case of vertical controls, or the right-most edge for horizontal controls. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.

<br />

|                    Returns                     ||
|-----------|-------------------------------------|
| `boolean` | true on scrolled, else false <br /> |

|                                                               Throws                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |   |

### scrollToEnd

```
boolean scrollToEnd (int maxSwipes, 
                int steps)
```

Scrolls to the end of a scrollable layout element. The end can be at the bottom-most edge in the case of vertical controls, or the right-most edge for horizontal controls. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.

<br />

|                                           Parameters                                            ||
|-------------|------------------------------------------------------------------------------------|
| `maxSwipes` | `int` <br />                                                                       |
| `steps`     | `int`: use steps to control the speed, so that it may be a scroll, or fling <br /> |

|                    Returns                    ||
|-----------|------------------------------------|
| `boolean` | true on scrolled else false <br /> |

|                                                               Throws                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) |   |

### setAsHorizontalList

```
UiScrollable setAsHorizontalList ()
```

Set the direction of swipes to be horizontal when performing scroll actions.

<br />

|                                                              Returns                                                              ||
|-------------------------------------------------------------------------------------------------------|----------------------------|
| [UiScrollable](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable) | reference to itself <br /> |

### setAsVerticalList

```
UiScrollable setAsVerticalList ()
```

Set the direction of swipes to be vertical when performing scroll actions.

<br />

|                                                              Returns                                                              ||
|-------------------------------------------------------------------------------------------------------|----------------------------|
| [UiScrollable](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable) | reference to itself <br /> |

### setMaxSearchSwipes

```
UiScrollable setMaxSearchSwipes (int swipes)
```

Sets the maximum number of scrolls allowed when performing a scroll action in search of a child element. See[getChildByDescription(UiSelector, String)](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#getChildByDescription(android.support.test.uiautomator.UiSelector, java.lang.String))and[getChildByText(UiSelector, String)](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable#getChildByText(android.support.test.uiautomator.UiSelector, java.lang.String)).

<br />

|                                   Parameters                                   ||
|----------|----------------------------------------------------------------------|
| `swipes` | `int`: the number of search swipes to perform until giving up <br /> |

|                                                              Returns                                                              ||
|-------------------------------------------------------------------------------------------------------|----------------------------|
| [UiScrollable](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable) | reference to itself <br /> |

### setSwipeDeadZonePercentage

```
UiScrollable setSwipeDeadZonePercentage (double swipeDeadZonePercentage)
```

Sets the percentage of a widget's size that's considered as no-touch zone when swiping. The no-touch zone is set as percentage of a widget's total width or height, denoting a margin around the swipable area of the widget. Swipes must always start and end inside this margin. This is important when the widget being swiped may not respond to the swipe if started at a point too near to the edge. The default is 10% from either edge.

<br />

|                               Parameters                               ||
|---------------------------|---------------------------------------------|
| `swipeDeadZonePercentage` | `double`: is a value between 0 and 1 <br /> |

|                                                              Returns                                                              ||
|-------------------------------------------------------------------------------------------------------|----------------------------|
| [UiScrollable](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable) | reference to itself <br /> |

## Protected methods

### exists

```
boolean exists (UiSelector selector)
```

Used privately when performing swipe searches to decide if an element has become visible or not.

<br />

|                  Returns                   ||
|-----------|---------------------------------|
| `boolean` | true if found else false <br /> |

-

  ## Interfaces

  - [IAutomationSupport](https://developer.android.com/reference/android/support/test/uiautomator/IAutomationSupport)
  - [UiWatcher](https://developer.android.com/reference/android/support/test/uiautomator/UiWatcher)
-

  ## Classes

  - [By](https://developer.android.com/reference/android/support/test/uiautomator/By)
  - [BySelector](https://developer.android.com/reference/android/support/test/uiautomator/BySelector)
  - [Configurator](https://developer.android.com/reference/android/support/test/uiautomator/Configurator)
  - [EventCondition](https://developer.android.com/reference/android/support/test/uiautomator/EventCondition)
  - [SearchCondition](https://developer.android.com/reference/android/support/test/uiautomator/SearchCondition)
  - [UiAutomatorInstrumentationTestRunner](https://developer.android.com/reference/android/support/test/uiautomator/UiAutomatorInstrumentationTestRunner)
  - [UiAutomatorTestCase](https://developer.android.com/reference/android/support/test/uiautomator/UiAutomatorTestCase)
  - [UiCollection](https://developer.android.com/reference/android/support/test/uiautomator/UiCollection)
  - [UiDevice](https://developer.android.com/reference/android/support/test/uiautomator/UiDevice)
  - [UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)
  - [UiObject2](https://developer.android.com/reference/android/support/test/uiautomator/UiObject2)
  - [UiObject2Condition](https://developer.android.com/reference/android/support/test/uiautomator/UiObject2Condition)
  - [UiScrollable](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable)
  - [UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)
  - [Until](https://developer.android.com/reference/android/support/test/uiautomator/Until)
-

  ## Enums

  - [Direction](https://developer.android.com/reference/android/support/test/uiautomator/Direction)
-

  ## Exceptions

  - [StaleObjectException](https://developer.android.com/reference/android/support/test/uiautomator/StaleObjectException)
  - [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException)