# ViewFinder

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/ViewFinder.java+class:androidx.test.espresso.ViewFinder)

*** ** * ** ***


```
public interface ViewFinder
```

<br />

Known direct subclasses [ViewFinderImpl](https://developer.android.com/reference/androidx/test/espresso/base/ViewFinderImpl)

|---|---|
| `https://developer.android.com/reference/androidx/test/espresso/base/ViewFinderImpl` | Implementation of `https://developer.android.com/reference/androidx/test/espresso/ViewFinder`. |

*** ** * ** ***

Uses matchers to locate particular views within the view hierarchy.

## Summary

| ### Public methods |
|---|---|
| `abstract https://developer.android.com/reference/android/view/View.html` | `https://developer.android.com/reference/androidx/test/espresso/ViewFinder#getView()()` Immediately locates a single view within the provided view hierarchy. |

## Public methods

### getView

```
abstract View getView()
```

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

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/test/espresso/AmbiguousViewMatcherException` | when multiple views match |
| `https://developer.android.com/reference/androidx/test/espresso/NoMatchingViewException` | when no views match. |