textinput.test.text

getTextInput(id).test.text("string")

or getScale(id).test.text( /RegExp/ )

Tests for a match with the text in the input box.

Example:

[js highlight=”7″ try=”true”]newTextInput(“haiku”, “hatsu shigure\nsaru mo komino o\nhoshige nari”)
.settings.lines(3)
.print()
,
newButton(“save”, “Save”)
.print()
.wait( getTextInput(“haiku”).test.text(/^.+[\r\n].+[\r\n].+$/) )[/js]

Adds a 3-line input box to the screen containing a haiku (note the \n to insert linebreaks in the text) above a Save button and waits for a click on the button. The click is validated only if, at the moment of the click, the text in the input box contains three lines of text.