Set text - operation

Set text of an element such as a text field / input. This operation is currently available for Android TV, Apple TV (tvOS), Websites, Roku and Xbox One Native platforms.


Set text basics

To perform this operation in the Suitest Test editor use the Set text line:

Set login information
Set login information

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.

Set login information if elements are in correct state
Set login information if elements are in correct state

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');
}