{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

ViewFinderImpl

class ViewFinderImpl : ViewFinder


Implementation of ViewFinder.

Summary

Public constructors

Public functions

View!

Immediately locates a single view within the provided view hierarchy.

Public constructors

ViewFinderImpl

ViewFinderImpl()

Public functions

getView

fun getView(): View!

Immediately locates a single view within the provided view hierarchy.

If multiple views match, or if no views match the appropriate exception is thrown.

Returns
View!

A singular view which matches the matcher we were constructed with.

Throws
androidx.test.espresso.AmbiguousViewMatcherException: androidx.test.espresso.AmbiguousViewMatcherException

when multiple views match

androidx.test.espresso.NoMatchingViewException: androidx.test.espresso.NoMatchingViewException

when no views match.