# RootViewException

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

*** ** * ** ***


```
public interface RootViewException extends EspressoException
```

<br />

Known direct subclasses [AmbiguousViewMatcherException](https://developer.android.com/reference/androidx/test/espresso/AmbiguousViewMatcherException), [NoMatchingViewException](https://developer.android.com/reference/androidx/test/espresso/NoMatchingViewException)

|---|---|
| `https://developer.android.com/reference/androidx/test/espresso/AmbiguousViewMatcherException` | An exception which indicates that a `Matcher<View>` matched multiple views in the hierarchy when only one view was expected. |
| `https://developer.android.com/reference/androidx/test/espresso/NoMatchingViewException` | Indicates that a given matcher did not match any elements in the view hierarchy. |

*** ** * ** ***

An `https://developer.android.com/reference/androidx/test/espresso/EspressoException` that can provide a Root View.

Types which implement this are also expected to extend `https://developer.android.com/reference/java/lang/Throwable.html` or any of its sub-types, as is typical of all Java exceptions.

## Summary

| ### Public methods |
|---|---|
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/View.html` | `https://developer.android.com/reference/androidx/test/espresso/RootViewException#getRootView()()` Returns the root view where this exception is thrown. |

## Public methods

### getRootView

```
abstract @NonNull View getRootView()
```

Returns the root view where this exception is thrown.