scale.test.selected

getScale(id).test.selected()

or getScale(id).test.selected( value )

Tests whether a button is selected.

If you pass a value, it will check that it matches the label of the selected button if it has a label, its index otherwise. If you do not pass a value, it simply checks that a selection happened.

Example:

[js highlight=”7″ try=”true”]newScale(“score”, 5)
.settings.before( newText(“label”, “Score: “) )
.print()
,
newButton(“validation”, “Validate”)
.print()
.wait( getScale(“score”).test.selected() )
[/js]

Adds a 5-point radio-button scale and a Validate button to the screen. Clicking on the Validate button is successful only when a radio button is selected.