Set text - operation¶
- Android TV / mobile
- Apple TV
- Apple TV Simulator
- Browsers
- HbbTV / Freeview Play
- LG webOS / Netcast
- Philips NetTV
- Playstation 4
- Roku (not Lite)
- Samsung Tizen / Orsay
- Xbox One
This operations sets text of an element such as a text field / input to specified string.
Set text basics¶
To perform this operation in the Suitest Test editor use the Set text line:
To perform this operation in the Suitest JavaScript API use
the setText
command:
await assert.element('loginTextBox').exists().timeout(2000);
await assert.element('loginTextBox').setText('login@suite.st');
await assert.element('passwordTextBox').setText('myPassWord');
Set text only if a specific condition is met¶
You can combine the Set text operation with an Assertion and instruct Suitest to run this operation only if the condition is satisfied.
In JavaScript API:
if (await suitest.element('loginTextBox').matches([
PROP.HEIGHT,
PROP.LEFT,
PROP.TOP,
PROP.WIDTH,
])) {
await assert.element('loginTextBox').setText('login@suite.st');
}
if (await suitest.element('passwordTextBox').exists()) {
await assert.element('passwordTextBox').setText('myPassWord');
}