# ViewFinder

Summary:[Methods](https://developer.android.com/reference/android/support/test/espresso/ViewFinder#pubmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/test/espresso/ViewFinder#)  

# ViewFinder

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public


interface
ViewFinder
`  
`


`

|------------------------------------------|
| android.support.test.espresso.ViewFinder |

|---|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/ViewFinder#)Known Indirect Subclasses [ViewFinderImpl](https://developer.android.com/reference/android/support/test/espresso/base/ViewFinderImpl) |-------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------| | [ViewFinderImpl](https://developer.android.com/reference/android/support/test/espresso/base/ViewFinderImpl) | Implementation of[ViewFinder](https://developer.android.com/reference/android/support/test/espresso/ViewFinder). | ||

<br />

*** ** * ** ***

Uses matchers to locate particular views within the view hierarchy.

## Summary

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

## Public methods

### getView

```
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.

<br />

|                                                                      Returns                                                                       ||
|------------------------------------------------------------------------|----------------------------------------------------------------------------|
| [View](https://developer.android.com/reference/android/view/View.html) | A singular view which matches the matcher we were constructed with. <br /> |

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

-

  ## Interfaces

  - [EspressoException](https://developer.android.com/reference/android/support/test/espresso/EspressoException)
  - [FailureHandler](https://developer.android.com/reference/android/support/test/espresso/FailureHandler)
  - [IdlingResource](https://developer.android.com/reference/android/support/test/espresso/IdlingResource)
  - [IdlingResource.ResourceCallback](https://developer.android.com/reference/android/support/test/espresso/IdlingResource.ResourceCallback)
  - [UiController](https://developer.android.com/reference/android/support/test/espresso/UiController)
  - [ViewAction](https://developer.android.com/reference/android/support/test/espresso/ViewAction)
  - [ViewAssertion](https://developer.android.com/reference/android/support/test/espresso/ViewAssertion)
  - [ViewFinder](https://developer.android.com/reference/android/support/test/espresso/ViewFinder)
  - [ViewInteractionComponent](https://developer.android.com/reference/android/support/test/espresso/ViewInteractionComponent)
-

  ## Classes

  - [AmbiguousViewMatcherException.Builder](https://developer.android.com/reference/android/support/test/espresso/AmbiguousViewMatcherException.Builder)
  - [DataInteraction](https://developer.android.com/reference/android/support/test/espresso/DataInteraction)
  - [DataInteraction.DisplayDataMatcher](https://developer.android.com/reference/android/support/test/espresso/DataInteraction.DisplayDataMatcher)
  - [Espresso](https://developer.android.com/reference/android/support/test/espresso/Espresso)
  - [IdlingPolicies](https://developer.android.com/reference/android/support/test/espresso/IdlingPolicies)
  - [IdlingPolicy](https://developer.android.com/reference/android/support/test/espresso/IdlingPolicy)
  - [IdlingRegistry](https://developer.android.com/reference/android/support/test/espresso/IdlingRegistry)
  - [NoMatchingViewException.Builder](https://developer.android.com/reference/android/support/test/espresso/NoMatchingViewException.Builder)
  - [PerformException.Builder](https://developer.android.com/reference/android/support/test/espresso/PerformException.Builder)
  - [Root](https://developer.android.com/reference/android/support/test/espresso/Root)
  - [Root.Builder](https://developer.android.com/reference/android/support/test/espresso/Root.Builder)
  - [ViewInteraction](https://developer.android.com/reference/android/support/test/espresso/ViewInteraction)
-

  ## Exceptions

  - [AmbiguousViewMatcherException](https://developer.android.com/reference/android/support/test/espresso/AmbiguousViewMatcherException)
  - [AppNotIdleException](https://developer.android.com/reference/android/support/test/espresso/AppNotIdleException)
  - [IdlingResourceTimeoutException](https://developer.android.com/reference/android/support/test/espresso/IdlingResourceTimeoutException)
  - [InjectEventSecurityException](https://developer.android.com/reference/android/support/test/espresso/InjectEventSecurityException)
  - [NoActivityResumedException](https://developer.android.com/reference/android/support/test/espresso/NoActivityResumedException)
  - [NoMatchingRootException](https://developer.android.com/reference/android/support/test/espresso/NoMatchingRootException)
  - [NoMatchingViewException](https://developer.android.com/reference/android/support/test/espresso/NoMatchingViewException)
  - [PerformException](https://developer.android.com/reference/android/support/test/espresso/PerformException)