{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

FindersKt

public final class FindersKt


Summary

Public methods

static final @NonNull SemanticsNodeInteractionCollection
onAllNodesWithContentDescription(
    @NonNull SemanticsNodeInteractionsProvider receiver,
    @NonNull String label,
    boolean substring,
    boolean ignoreCase,
    boolean useUnmergedTree
)

Finds all semantics nodes with the given label as ContentDescription.

static final @NonNull SemanticsNodeInteractionCollection
onAllNodesWithTag(
    @NonNull SemanticsNodeInteractionsProvider receiver,
    @NonNull String testTag,
    boolean useUnmergedTree
)

Finds all semantics nodes identified by the given tag.

static final @NonNull SemanticsNodeInteractionCollection
onAllNodesWithText(
    @NonNull SemanticsNodeInteractionsProvider receiver,
    @NonNull String text,
    boolean substring,
    boolean ignoreCase,
    boolean useUnmergedTree
)

Finds all semantics nodes with the given text.

static final @NonNull SemanticsNodeInteraction
onNodeWithContentDescription(
    @NonNull SemanticsNodeInteractionsProvider receiver,
    @NonNull String label,
    boolean substring,
    boolean ignoreCase,
    boolean useUnmergedTree
)

Finds a semantics node with the given contentDescription.

static final @NonNull SemanticsNodeInteraction
onNodeWithTag(
    @NonNull SemanticsNodeInteractionsProvider receiver,
    @NonNull String testTag,
    boolean useUnmergedTree
)

Finds a semantics node identified by the given tag.

static final @NonNull SemanticsNodeInteraction
onNodeWithText(
    @NonNull SemanticsNodeInteractionsProvider receiver,
    @NonNull String text,
    boolean substring,
    boolean ignoreCase,
    boolean useUnmergedTree
)

Finds a semantics node with the given text.

static final @NonNull SemanticsNodeInteraction
onRoot(
    @NonNull SemanticsNodeInteractionsProvider receiver,
    boolean useUnmergedTree
)

Finds the root semantics node of the Compose tree.

Public methods

onAllNodesWithContentDescription

public static final @NonNull SemanticsNodeInteractionCollection onAllNodesWithContentDescription(
    @NonNull SemanticsNodeInteractionsProvider receiver,
    @NonNull String label,
    boolean substring,
    boolean ignoreCase,
    boolean useUnmergedTree
)

Finds all semantics nodes with the given label as ContentDescription.

For usage patterns and semantics concepts see SemanticsNodeInteraction

Parameters
boolean substring

Whether to use substring matching.

boolean ignoreCase

Whether case should be ignored.

boolean useUnmergedTree

Find within merged composables like Buttons.

See also
onAllNodes

for general find method.

onAllNodesWithTag

public static final @NonNull SemanticsNodeInteractionCollection onAllNodesWithTag(
    @NonNull SemanticsNodeInteractionsProvider receiver,
    @NonNull String testTag,
    boolean useUnmergedTree
)

Finds all semantics nodes identified by the given tag.

For usage patterns and semantics concepts see SemanticsNodeInteraction

Parameters
boolean useUnmergedTree

Find within merged composables like Buttons.

See also
onAllNodes

for general find method.

onAllNodesWithText

public static final @NonNull SemanticsNodeInteractionCollection onAllNodesWithText(
    @NonNull SemanticsNodeInteractionsProvider receiver,
    @NonNull String text,
    boolean substring,
    boolean ignoreCase,
    boolean useUnmergedTree
)

Finds all semantics nodes with the given text.

For usage patterns and semantics concepts see SemanticsNodeInteraction

Parameters
boolean substring

Whether to use substring matching.

boolean ignoreCase

Whether case should be ignored.

boolean useUnmergedTree

Find within merged composables like Buttons.

See also
onAllNodes

for general find method.

onNodeWithContentDescription

public static final @NonNull SemanticsNodeInteraction onNodeWithContentDescription(
    @NonNull SemanticsNodeInteractionsProvider receiver,
    @NonNull String label,
    boolean substring,
    boolean ignoreCase,
    boolean useUnmergedTree
)

Finds a semantics node with the given contentDescription.

For usage patterns and semantics concepts see SemanticsNodeInteraction

Parameters
boolean substring

Whether to use substring matching.

boolean ignoreCase

Whether case should be ignored.

boolean useUnmergedTree

Find within merged composables like Buttons.

See also
onNode

for general find method.

onNodeWithTag

public static final @NonNull SemanticsNodeInteraction onNodeWithTag(
    @NonNull SemanticsNodeInteractionsProvider receiver,
    @NonNull String testTag,
    boolean useUnmergedTree
)

Finds a semantics node identified by the given tag.

For usage patterns and semantics concepts see SemanticsNodeInteraction

Parameters
boolean useUnmergedTree

Find within merged composables like Buttons.

See also
onNode

for general find method.

onNodeWithText

public static final @NonNull SemanticsNodeInteraction onNodeWithText(
    @NonNull SemanticsNodeInteractionsProvider receiver,
    @NonNull String text,
    boolean substring,
    boolean ignoreCase,
    boolean useUnmergedTree
)

Finds a semantics node with the given text.

For usage patterns and semantics concepts see SemanticsNodeInteraction

Parameters
boolean substring

Whether to use substring matching.

boolean ignoreCase

Whether case should be ignored.

boolean useUnmergedTree

Find within merged composables like Buttons.

See also
onNode

for general find method.

onRoot

public static final @NonNull SemanticsNodeInteraction onRoot(
    @NonNull SemanticsNodeInteractionsProvider receiver,
    boolean useUnmergedTree
)

Finds the root semantics node of the Compose tree.

Useful for example for screenshot tests of the entire scene.

For usage patterns and semantics concepts see SemanticsNodeInteraction

Parameters
boolean useUnmergedTree

Find within merged composables like Buttons.