onNodeWithText

abstract fun onNodeWithText(text: @Nls String, substring: Boolean = false): SwingNodeInteraction<Component>

Finds the single node whose text equals text (or contains it when substring is true). The match is resolved lazily when the returned interaction is first used.

Return

a handle that fails on use unless exactly one node matches.

Parameters

text

matched against a label's, button's or text component's own text.

substring

true matches text that merely contains text; false by default.