withIndex

fun withIndex(matcher: Matcher<View>, index: Int): Matcher<View>(source)

Matches only the indexth view, in breadth-first order, among views matching matcher.

Stateless: the match list is recomputed from the view's hierarchy, so the matcher stays correct when Espresso evaluates it many times, unlike a counting matcher.

Return

The matcher.

Parameters

matcher

Selects the candidates.

index

The zero-based position among candidates.