---
title: "onChild"
description: "Returns exactly one child of this node.

Use this only if this node has exactly one child.

Any subsequent operation on its result will expect exactly one element found (unless
[SemanticsNodeInteraction.assertDoesNotExist] is used) and will throw [AssertionError] if none or
more than one element is found."
type: "function"
---

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


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


```kotlin
@CheckResult
fun SemanticsNodeInteraction.onChild(): SemanticsNodeInteraction
```


Returns exactly one child of this node.

Use this only if this node has exactly one child.

Any subsequent operation on its result will expect exactly one element found (unless
`SemanticsNodeInteraction.assertDoesNotExist` is used) and will throw `AssertionError` if none or
more than one element is found.



