---
title: "onLast"
description: "Returns the last node in this collection.

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

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


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


```kotlin
@CheckResult
fun SemanticsNodeInteractionCollection.onLast(): SemanticsNodeInteraction
```


Returns the last node in this collection.

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



