---
title: "performSemanticsAction"
description: "Provides support to call custom semantics actions on this node.

This method is supposed to be used for actions with parameters.

This will properly verify that the actions exists and provide clear error message in case it does
not. It also handle synchronization and performing the action on the UI thread. This call is
blocking until the action is performed"
type: "function"
---

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


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


```kotlin
fun <T : Function<Boolean>> SemanticsNodeInteraction.performSemanticsAction(
    key: SemanticsPropertyKey<AccessibilityAction<T>>,
    invocation: (T) -> Unit,
): SemanticsNodeInteraction
```


Provides support to call custom semantics actions on this node.

This method is supposed to be used for actions with parameters.

This will properly verify that the actions exists and provide clear error message in case it does
not. It also handle synchronization and performing the action on the UI thread. This call is
blocking until the action is performed

#### Parameters

| | |
| --- | --- |
| key | Key of the action to be performed. |
| invocation | Place where you call your action. In the argument is provided the underlying action from the given Semantics action. |


#### Returns

| | |
| --- | --- |
|  | The `SemanticsNodeInteraction` that is the receiver of this method |




<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun SemanticsNodeInteraction.performSemanticsAction(
    key: SemanticsPropertyKey<AccessibilityAction<() -> Boolean>>
): SemanticsNodeInteraction
```


Provides support to call custom semantics actions on this node.

This method is for calling actions that have no parameters.

This will properly verify that the actions exists and provide clear error message in case it does
not. It also handle synchronization and performing the action on the UI thread. This call is
blocking until the action is performed

#### Parameters

| | |
| --- | --- |
| key | Key of the action to be performed. |


#### Returns

| | |
| --- | --- |
|  | The `SemanticsNodeInteraction` that is the receiver of this method |




