# ViewFinderImpl

# ViewFinderImpl

Artifact:[androidx.test.espresso:espresso-core](https://developer.android.com/jetpack/androidx/releases/test-espresso)  
[View Source](https://cs.android.com/search?q=file:androidx/test/espresso/base/ViewFinderImpl.java+class:androidx.test.espresso.base.ViewFinderImpl)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/test/espresso/base/ViewFinderImpl "View this page in Java")

<br />

```
class ViewFinderImpl : ViewFinder
```

<br />

*** ** * ** ***

Implementation of[ViewFinder](https://developer.android.com/reference/kotlin/androidx/test/espresso/ViewFinder).

## Summary

|                           ### Public functions                            |
|---------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [View](https://developer.android.com/reference/android/view/View.html)`!` | [getView](https://developer.android.com/reference/kotlin/androidx/test/espresso/base/ViewFinderImpl#getView())`()` Immediately locates a single view within the provided view hierarchy. |

## 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](https://developer.android.com/reference/android/view/View.html)`!` | A singular view which matches the matcher we were constructed with. |

|                                                                           Throws                                                                            |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------|
| [androidx.test.espresso.AmbiguousViewMatcherException](https://developer.android.com/reference/kotlin/androidx/test/espresso/AmbiguousViewMatcherException) | when multiple views match |
| [androidx.test.espresso.NoMatchingViewException](https://developer.android.com/reference/kotlin/androidx/test/espresso/NoMatchingViewException)             | when no views match.      |