# NoMatchingViewException

Summary:[Nested Classes](https://developer.android.com/reference/android/support/test/espresso/NoMatchingViewException#nestedclasses)\|[Methods](https://developer.android.com/reference/android/support/test/espresso/NoMatchingViewException#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/test/espresso/NoMatchingViewException#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/test/espresso/NoMatchingViewException#)  

# NoMatchingViewException

| 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

final

class
NoMatchingViewException
`  
`


``


``


``

extends `[RuntimeException](https://developer.android.com/reference/java/lang/RuntimeException.html)`


``


implements

`[EspressoException](https://developer.android.com/reference/android/support/test/espresso/EspressoException)`


`

|---|---|---|---|-------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||||
| ↳ | [java.lang.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) ||||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/java/lang/Exception.html) |||
|   |   | ↳ | [java.lang.RuntimeException](https://developer.android.com/reference/java/lang/RuntimeException.html) ||
|   |   |   | ↳ | android.support.test.espresso.NoMatchingViewException |

<br />

*** ** * ** ***

Indicates that a given matcher did not match any elements in the view hierarchy.

Contains details about the matcher and the current view hierarchy to aid in debugging.

Since this is usually an unrecoverable error this exception is a runtime exception.

References to the view and failing matcher are purposefully not included in the state of this object - since it will most likely be created on the UI thread and thrown on the instrumentation thread, it would be invalid to touch the view on the instrumentation thread. Also the view hierarchy may have changed since exception creation (leading to more confusion).

## Summary

|                                                                                                                                   ### Nested classes                                                                                                                                    ||
|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [NoMatchingViewException.Builder](https://developer.android.com/reference/android/support/test/espresso/NoMatchingViewException.Builder) Builder for[NoMatchingViewException](https://developer.android.com/reference/android/support/test/espresso/NoMatchingViewException). |

|                                                                                                                                                            ### Public methods                                                                                                                                                            ||
|----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[String](https://developer.android.com/reference/java/lang/String.html) | ` `[getViewMatcherDescription](https://developer.android.com/reference/android/support/test/espresso/NoMatchingViewException#getViewMatcherDescription())`() ` Returns a string description of the ViewMatcher that did not match any view in the hierarchy. |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/NoMatchingViewException#)From class` `[java.lang.Throwable](https://developer.android.com/reference/java/lang/Throwable.html)` ` |----------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------| | ` final void`                                                                                      | ` addSuppressed(`[Throwable](https://developer.android.com/reference/java/lang/Throwable.html)` arg0) `                   | | ` `[Throwable](https://developer.android.com/reference/java/lang/Throwable.html)                   | ` fillInStackTrace() `                                                                                                    | | ` `[Throwable](https://developer.android.com/reference/java/lang/Throwable.html)                   | ` getCause() `                                                                                                            | | ` `[String](https://developer.android.com/reference/java/lang/String.html)                         | ` getLocalizedMessage() `                                                                                                 | | ` `[String](https://developer.android.com/reference/java/lang/String.html)                         | ` getMessage() `                                                                                                          | | ` `[StackTraceElement[]](https://developer.android.com/reference/java/lang/StackTraceElement.html) | ` getStackTrace() `                                                                                                       | | ` final `[Throwable[]](https://developer.android.com/reference/java/lang/Throwable.html)           | ` getSuppressed() `                                                                                                       | | ` `[Throwable](https://developer.android.com/reference/java/lang/Throwable.html)                   | ` initCause(`[Throwable](https://developer.android.com/reference/java/lang/Throwable.html)` arg0) `                       | | ` void`                                                                                            | ` printStackTrace() `                                                                                                     | | ` void`                                                                                            | ` printStackTrace(`[PrintWriter](https://developer.android.com/reference/java/io/PrintWriter.html)` arg0) `               | | ` void`                                                                                            | ` printStackTrace(`[PrintStream](https://developer.android.com/reference/java/io/PrintStream.html)` arg0) `               | | ` void`                                                                                            | ` setStackTrace(`[StackTraceElement[]](https://developer.android.com/reference/java/lang/StackTraceElement.html)` arg0) ` | | ` `[String](https://developer.android.com/reference/java/lang/String.html)                         | ` toString() `                                                                                                            | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/NoMatchingViewException#)From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object.html)` ` |-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object.html)          | ` clone() `                                                                                | | ` boolean`                                                                          | ` equals(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void`                                                                             | ` finalize() `                                                                             | | ` final `[Class](https://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                             | | ` int`                                                                              | ` hashCode() `                                                                             | | ` final void`                                                                       | ` notify() `                                                                               | | ` final void`                                                                       | ` notifyAll() `                                                                            | | ` `[String](https://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                             | | ` final void`                                                                       | ` wait(long arg0, int arg1) `                                                              | | ` final void`                                                                       | ` wait(long arg0) `                                                                        | | ` final void`                                                                       | ` wait() `                                                                                 | ||

## Public methods

### getViewMatcherDescription

```
String getViewMatcherDescription ()
```

Returns a string description of the ViewMatcher that did not match any view in the hierarchy.

<br />

|                                     Returns                                     ||
|-------------------------------------------------------------------------|--------|
| [String](https://developer.android.com/reference/java/lang/String.html) | <br /> |

-

  ## 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)