# RootViewException

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

*** ** * ** ***

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

<br />

```
interface RootViewException : EspressoException
```

<br />

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

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

*** ** * ** ***

An[EspressoException](https://developer.android.com/reference/kotlin/androidx/test/espresso/EspressoException)that can provide a Root View.

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

## Summary

|                          ### Public functions                          |
|------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [View](https://developer.android.com/reference/android/view/View.html) | [getRootView](https://developer.android.com/reference/kotlin/androidx/test/espresso/RootViewException#getRootView())`()` Returns the root view where this exception is thrown. |

## Public functions

### getRootView

```
fun getRootView(): View
```

Returns the root view where this exception is thrown.