performScrollToIndex

Function

Common
fun SemanticsNodeInteraction.performScrollToIndex(index: Int): SemanticsNodeInteraction

Scrolls a scrollable container with items to the item with the given index.

Note that not all scrollable containers have item indices. For example, a scrollable doesn't have items with an index, while LazyColumn does.

This action should be performed on a node that is a scrollable container, not on a node that is part of the content of that container.

Throws an AssertionError if the node doesn't have ScrollToIndex defined.

Parameters

indexThe index of the item to scroll to

Returns

The SemanticsNodeInteraction that is the receiver of this method