The following instructions will guide you through the setup and configuration of your stb-tester ONE appliance. If you need any help, please contact us at email@example.com.
We also have a short video that covers the physical setup and demonstrates the web interface.
Connect the stb-tester ONE as per the above diagram. Then press the power button on the front of the stb-tester ONE.
- The infrared transmitter is self-adhesive; stick it over the set-top box’s IR receiver. This is a low-power transmitter (to avoid interfering with other set-top boxes in your test lab) so it has to be close against the IR receiver. Some set-top boxes are very sensitive to the placement of the transmitter; using a torch can help to find the position of the IR receiver behind the set-top box’s plastic case.
We may have also supplied a USB Infrared Receiver, shown at right. Do not plug this into the stb-tester ONE. It is only used when you need to record an infrared configuration for your system-under-test (we will explain this in Record your remote control configuration, below).
What is the stb-tester ONE’s IP address?¶
The stb-tester ONE’s MAC address is printed on a sticker at the front of the appliance. Ask your network administrator to assign a static IP address for this MAC address.
For example, if the front of the stb-tester ONE says “stb-tester-one-abcdef123456.local”, then the MAC address is “ab:cd:ef:12:34:56”.
Once you know the IP address, go to
http://<ip address> in your browser.
On Linux or Mac OS X, you can use the stb-tester ONE’s Zeroconf address
directly in your web browser. This address is on the front of the stb-tester
ONE. For example:
If you are running Linux, you can also find out the stb-tester ONE’s IP
address by running
avahi-discover and searching for “stb-tester-one-…”.
You can install avahi-discover with your package manager (apt-get on Ubuntu, yum on RedHat, etc).
Install software updates¶
Visit the stb-tester ONE’s user interface in your browser:
When it boots, your stb-tester ONE will connect to our update servers and download a software update if there is one available. When it is ready to install, you will see a green banner like the screenshot above.
Press “Install software update”.
The stb-tester ONE will install the new software and reboot. This takes about 30 seconds in total.
Updating your stb-tester ONE is always safe; our software updates never introduce breaking changes. We have a separate mechanism for managing breaking changes.
Run a test¶
The stb-tester ONE comes with some example test cases. Select one (or more) test cases and press “Run tests”.
While the test runs, you will see the status of the test in the right-hand side of the stb-tester ONE’s user interface.
This test will probably fail, because:
- Your set-top box doesn’t understand the infrared signals that the stb-tester ONE is sending.
- Your set-top box doesn’t behave in the way that the test case expects.
Don’t worry! Soon we will show you how to specify the infrared configuration for your set-top box, and how to write your own test cases.
View test results¶
When the test has completed, click on “Test results”, then select “master”. You will see the results of all the tests that have run before. Select a test to view a video recording, logs, etc.
Clone the test-pack git repository¶
(This section assumes a basic familiarity with git. See http://git-scm.com/ for downloads and tutorials.)
The stb-tester ONE’s configuration is stored in a git repository, along with the test cases (Python scripts).
Clone the git repository from the stb-tester ONE:
git clone http://<address>/git/test-pack.git
<adress> is the IP address or hostname of the stb-tester ONE – see
What is the stb-tester ONE’s IP address? above).
Record your remote control configuration¶
The stb-tester ONE needs to know the infrared protocol that your system-under-test understands. To record this information you will need a Windows PC and the USB Infrared Receiver that you received with your stb-tester ONE.
Connect the USB Infrared Receiver to your Windows PC and install the RedRat3-II driver.
Now run the RedRat IR Signal Database Utility. Select Edit > New Device/Remote Wizard.
Follow the instructions in the Wizard to record the infrared configuration for your device.
When the Wizard asks you to press a button, press the button as briefly as possible. This is so that it doesn’t record a longer signal (when you play back a single button-press during a test, you don’t want it to look like a double press).
When you have finished, select your device in the RedRat window:
Select Edit > Export Device/Remote > LIRC Format (Linux).
Save the file, then copy it to your test-pack git repository as
<name> is any
name to identify the remote-control or the set-top box).
We recommend that you name the remote-control buttons to match the Linux
key names. You can change the names by editing the
For example, instead of “0” use “KEY_0”:
Commit and push your changes¶
Commit the new or changed file to your git repository:
git add config/remote-control/<name>.lircd.conf git commit
And push your change to the stb-tester ONE:
Test your new infrared configuration by going to the Manual control section of the stb-tester ONE’s user interface:
Write a new test case¶
The following instructions are also available as a video here.
Test cases are Python functions¶
Test cases are Python functions stored in the test-pack git repository under
tests/*.py. The function name must begin with
test_ (for example
test-pack/tests/example_test.py (or create a new Python file in that
directory) and create your own Python function. In the test case you can use
the following functions:
stbt.press("KEY_EPG")to send an infrared key-press. You can use any of the key names from the previous section (Record your remote control configuration) if you recorded the corresponding signal from your remote control.
stbt.wait_for_match("guide-logo.png")to search for an image and fail the test if the specified image isn’t found within 10 seconds. See Screenshots below for how to create these images.
wait_for_matchbut instead of failing the test, it returns a false value if the image isn’t found. You can use this to implement more complex logic in your tests.
stbt.wait_for_motion(mask="channel-patch-mask.png")searches for motion and fails the test if it doesn’t detect motion within 10 seconds. You can specify an optional
maskimage to specify which areas of the frame to ignore.
For more details, see the stbt Python API reference.
Press the Screenshot button underneath the live video view in the stb-tester ONE user interface. This will take a screenshot from the system-under-test as a PNG file.
Save the screenshot into your test-pack git repository under
test-pack/tests/. Open the image in your favourite image editor (for
example Paint on Windows, Preview.app on OS X, or Gimp on Linux). Crop the
image so that it only contains the part that you want to match in your test
The image you give to
stbt.wait_for_match in your Python code is a relative
path from the Python file itself. For example you can put your images in
test-pack/tests/images/ and use
What to read next¶
We strongly recommend that you read our Tutorials for test developers. They cover best practices to save you time and to ensure that your test scripts will be maintainable in the long term.
The stbt Python API reference starts with an overview of the functions provided by stb-tester. It is worth reading that overview; you don’t need to read the detailed reference for each function until you need to know more about that particular function.