# Root

# Root

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

*** ** * ** ***

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

<br />

```
class Root
```

<br />

*** ** * ** ***

Represents a root view in the application and optionally the layout params of the window holding it.

This class is used internally to determine which view root to run user provided matchers against it is not part of the public api.

## Summary

|                                              ### Nested types                                              |
|------------------------------------------------------------------------------------------------------------|
| `class `[Root.Builder](https://developer.android.com/reference/kotlin/androidx/test/espresso/Root.Builder) |

|                                                                                                           ### Public functions                                                                                                            |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [EspressoOptional](https://developer.android.com/reference/kotlin/androidx/test/espresso/util/EspressoOptional)`<`[WindowManager.LayoutParams](https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html)`!>!` | ~~[getWindowLayoutParams](https://developer.android.com/reference/kotlin/androidx/test/espresso/Root#getWindowLayoutParams())~~`()` **This function is deprecated.** use[getWindowLayoutParams2](https://developer.android.com/reference/kotlin/androidx/test/espresso/Root#getWindowLayoutParams2()) <br /> |
| [WindowManager.LayoutParams](https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html)`!`                                                                                                                     | [getWindowLayoutParams2](https://developer.android.com/reference/kotlin/androidx/test/espresso/Root#getWindowLayoutParams2())`()`                                                                                                                                                                            |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                                                                       | [isReady](https://developer.android.com/reference/kotlin/androidx/test/espresso/Root#isReady())`()` Checks if the[Root](https://developer.android.com/reference/kotlin/androidx/test/espresso/Root)is ready.                                                                                                 |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`                                                                                                                                                      | [toString](https://developer.android.com/reference/kotlin/androidx/test/espresso/Root#toString())`()`                                                                                                                                                                                                        |

|                           ### Public properties                           |
|---------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| [View](https://developer.android.com/reference/android/view/View.html)`!` | [decorView](https://developer.android.com/reference/kotlin/androidx/test/espresso/Root#decorView()) |

## Public functions

### getWindowLayoutParams

```
fun [getWindowLayoutParams](https://developer.android.com/reference/kotlin/androidx/test/espresso/Root#getWindowLayoutParams())(): EspressoOptional<WindowManager.LayoutParams!>!
```
| **This function is deprecated.**   
|
use[getWindowLayoutParams2](https://developer.android.com/reference/kotlin/androidx/test/espresso/Root#getWindowLayoutParams2())  

### getWindowLayoutParams2

```
fun getWindowLayoutParams2(): WindowManager.LayoutParams!
```  

### isReady

```
fun isReady(): Boolean
```

Checks if the[Root](https://developer.android.com/reference/kotlin/androidx/test/espresso/Root)is ready. The UI is no longer in flux if layout of the root view is not being requested and the root view has window focus or is focusable.  

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|----------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | if the root view has focus |

### toString

```
fun toString(): String!
```  

## Public properties

### decorView

```
val decorView: View!
```