---
title: "onRoot"
description: "Finds the root semantics node of the Compose tree.

Useful for example for screenshot tests of the entire scene.

For usage patterns and semantics concepts see [SemanticsNodeInteraction]"
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
@CheckResult
fun SemanticsNodeInteractionsProvider.onRoot(
    useUnmergedTree: Boolean = false
): SemanticsNodeInteraction
```


Finds the root semantics node of the Compose tree.

Useful for example for screenshot tests of the entire scene.

For usage patterns and semantics concepts see `SemanticsNodeInteraction`

#### Parameters

| | |
| --- | --- |
| useUnmergedTree | If true, searches the unmerged semantics tree instead of the merged semantics tree. |




