Press button operation

  • Android TV / mobile
  • Apple TV
  • Apple TV Simulator
  • HbbTV / Freeview Play
  • LG webOS / Netcast
  • Philips NetTV
  • Playstation 4
  • Roku
  • Samsung Tizen / Orsay
  • Xbox One

This operation simulates pressing the specified key on the device's remote control. This operation is dedicated to devices featuring a remote control (see the list of supported platforms above). When testing websites use Send text. Check the button VRC constants for the Suitest JavaScript API.

Press button basics

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

Example lines pressing keys CHANNEL_UP, OK and DOWN

To perform this operation in the Suitest JavaScript API use the Press command:


Press multiple buttons in a row

The Press button operation accepts multiple buttons that will be pressed one after the other. The button presses are sent to the device sequentially with a delay of around 1000 ms.

Press 3 different buttons in a row

In JavaScript API:

await[suitest.VRC.OK, suitest.VRC.UP, suitest.VRC.DOWN]);

Press button a specific amount of times with a specified frequency

You can send repeated button presses to the device with a particular frequency. You can use this for example to check if the app (or device) can handle many frequent key presses gracefully.

Press down 10 times every 100 ms

In JavaScript API use repeat and interval:


The frequency parameter is expected to be between 0.01 seconds and 3600 seconds.

Device dependent: The input processing capabilities vary across devices. You may therefore experience a situation where the device is stalling or skipping key input altogether. This is especially true with a lower-end set-top boxes. Most TV's and set-top boxes will not be able to recognize key presses sent every ~250 ms or less.

When multiple keys are specified the entire sequence will be repeated the specified number of times. You can use this, for example, to move through the list of items in a zig-zag pattern or for pressing Enter and Back a number of times to test the application's stability.

Keep pressing button(s) until a condition is met

You can combine the press operation with an Assertion and instruct Suitest to keep pressing the button(s) until a specific condition is met.

Please note that the condition is being evaluated before each run (including the first one). Therefore the application has to be already running before the first evaluation.

Press forward until a video position is reached

In JavaScript API:

const video =;
const playedForTenSeconds = {
    name: suitest.PROP.VIDEO_POSITION,
    val: "10",
    type: suitest.COMP.EQUAL_GREATER,

// press forward until the video progress is more than 10 seconds

Press button(s) only if a condition is met

You can combine the Press operation with an Assertion and instruct Suitest to run this operation only if the condition is satisfied.

For instance, the application may pop up a dialog asking the user for their location the first time they use the app. The conditional button press can be used to reliably dismiss this dialogue.

Navigate to the element only if the element is visible

In JavaScript API:

const {press, element, VRC, PROP} = suitest;

if (await element('element').exists()) {
    await press(VRC.RIGHT).until(
        element('element').matches(PROP.BORDER_COLOR, '#0000FF')

    await press(VRC.OK);