---
title: "testTag"
description: "Applies a tag to allow modified element to be found in tests.

This is a convenience method for a [semantics] that sets [SemanticsPropertyReceiver.testTag]."
type: "modifier"
---

<div class='type'>Compose Modifier</div>

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


```kotlin
fun Modifier.testTag(tag: String) = this then TestTagElement(tag)
```


Applies a tag to allow modified element to be found in tests.

This is a convenience method for a `semantics` that sets `SemanticsPropertyReceiver.testTag`.



