Property

testTag

Test tag attached to this semantics node.

Source set: Common
public var SemanticsPropertyReceiver.testTag: String by SemanticsProperties.TestTag

Test tag attached to this semantics node.

This can be used to find nodes in testing frameworks:

    onNodeWithTag.

  • In Compose's built-in unit test framework, use with
  • extras with key "androidx.compose.ui.semantics.testTag"

  • For newer AccessibilityNodeInfo-based integration test frameworks, it can be matched in the
  • resource id if testTagsAsResourceId is true (for matching with 'By.res' in UIAutomator).

  • For legacy AccessibilityNodeInfo-based integration tests, it's optionally exposed as the
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: