Roku#

Stb-tester supports all Roku models, including the Streaming Sticks.

Roku HTTP remote control#

All Roku models except for the Streaming Sticks support infrared remote control. To control the Roku Streaming Sticks, you can use the Roku’s HTTP API instead.

Configuration:

  1. The Roku device and the Stb-tester Node must be on the same network.

  2. On the Roku, go to Settings > Network > About. Note the Roku’s IP address.

  3. On the Roku, go to Settings > System > Advanced system settings > Control by mobile apps > Network access. Make sure that it is set to “Default” or “Permissive”.

  4. In your test-pack, create a configuration file for each Stb-tester Node under config/test-farm/, for example config/test-farm/stb-tester-xxxxxxxxxxxx.conf (for more details see Configuration Reference: Node-specific configuration files).

  5. In the configuration file for the relevant Stb-tester Node, specify test_pack.default_remote_control=roku_http and device_under_test.ip_address=192.168.1.7 (change the actual IP address to the one you noted in step 2 above). For example:

    config/test-farm/stb-tester-xxxxxxxxxxxx.conf
    [test_pack]
    default_remote_control = roku_http
    
    [device_under_test]
    ip_address = 192.168.1.7
    

Key names#

In your test scripts you can use the following key names with stbt.press:

  • "KEY_BACK"

  • "KEY_HOME"

  • "KEY_UP"

  • "KEY_DOWN"

  • "KEY_LEFT"

  • "KEY_RIGHT"

  • "KEY_OK"

  • "KEY_AGAIN" (instant replay)

  • "KEY_INFO" (star, options)

  • "KEY_REWIND"

  • "KEY_PLAYPAUSE"

  • "KEY_FASTFORWARD"

You can also use the raw key names of Roku’s HTTP protocol directly (for example, "Lit_a" to enter the letter “a” when an on-screen keyboard is present).

Reliability#

We have tested 60,000 keypresses over 3 days without a single missed keypress (we validate that each and every keypress had the expected effect in the Roku’s UI).

Roku devices never really go to sleep, so you won’t have any issues in waking the device using the HTTP control mechanism.

Python API#

In your test scripts you can use the stbt.Roku API to launch an app, and to save logs from the Roku’s debug console. See the stbt.Roku API documentation for details.

Capturing logs#

Roku devices expose a debug console over the network. You can capture logs from this console using Stb-tester’s stbt.Roku.save_logs API. For detailed instructions, see Capturing logs from the device-under-test.