Test Manager User Guide
Test Manager User Guide
RedRat Ltd
July 2015
-1-
Contents
1. Introduction .......................................................................................................................4
2. TestManager Setup Overview ...........................................................................................5
3. TestManager Roles ............................................................................................................6
4. Interactive STB Control ......................................................................................................7
4.1 On-Screen Remotes ....................................................................................................7
4.1.1 Select Zone .........................................................................................................8
4.1.2 Select STBs ..........................................................................................................8
4.1.3 Use All STBs ........................................................................................................8
4.2 Graphical Representation of the STB Layout..............................................................8
4.2.1 Single STB Mode .................................................................................................9
4.2.2 Multi- STB Mode .................................................................................................9
4.2.3 Select All STBs .....................................................................................................9
4.2.4 Selecting a Zone..................................................................................................9
5. Zones..................................................................................................................................9
6. IR Signal Datasets.............................................................................................................10
7. Macros .............................................................................................................................12
8. Named Operations...........................................................................................................13
9. Control of STBs with a Remote Control Handset.............................................................14
10. Scripts ..............................................................................................................................16
10.1 The TM Script Language ........................................................................................... 16
10.1.1 Select ................................................................................................................16
10.1.2 Send ..................................................................................................................16
10.1.3 Wait ..................................................................................................................17
10.1.4 Loops ................................................................................................................17
10.1.5 Calling Scripts from Scripts ...............................................................................18
10.1.6 Comments ........................................................................................................18
10.1.7 Script Example ..................................................................................................18
10.2 Python Scripting .......................................................................................................19
10.3 Script Management ..................................................................................................19
10.3.1 Script Editing.....................................................................................................19
10.3.2 TM Script Validation .........................................................................................20
10.3.3 Script Execution ................................................................................................22
10.3.4 TM Script Capture.............................................................................................23
11. Log Output .......................................................................................................................25
11.1 Application Log Output.............................................................................................25
11.2 Script Log Output......................................................................................................25
12. Initiating Script Execution from Other Applications ........................................................26
12.1 TMSendCommand.exe .............................................................................................27
12.1.1 -script <script name> ........................................................................................27
12.1.2 –verbose ...........................................................................................................27
12.1.3 –help .................................................................................................................27
12.2 Getting Started with TMSendCommand.exe ...........................................................27
-2-
12.3 TMSendCommandW.exe..........................................................................................28
12.4 Successful Script Execution via TMSendCommand(W) ............................................28
13. TestManager Options ......................................................................................................29
13.1 Data Source Tab........................................................................................................29
13.2 Scripting Tab .............................................................................................................29
13.3 Script Capture Tab ....................................................................................................29
13.4 Control via Remote Tab ............................................................................................30
13.5 The Logging Tab ........................................................................................................30
13.6 The Misc Tab.............................................................................................................30
14. Saving/Restoring window properties ..............................................................................30
-3-
1. Introduction
TestManager is an application to support automated and interactive control of consumer
electronics equipment. Automated control takes places via scripts and to support testing of
the CE equipment through the output of sequences of infrared remote control commands.
Interactive control uses on-screen virtual remotes or physical handsets to route commands
to selected CE devices.
The concept of using scripts to automate sequences of remote control operations is quite
intuitive, but the power of the TestManager application lies in its ability to execute the same
scripts on banks of different equipment. The key to this is the correct configuration of the
test hardware and software, which is discussed in detail in the TestManager Administration
Guide.
Multi user: Configuration and user data is stored in database that can be accessed by
multiple clients allowing the creation and validation of test scripts from any computer.
Typically however only one computer will be used to control the hardware under test to
prevent users interfering with running tests.
Single user: Uses an internal database for all configuration and user data, so is not
accessible by any other clients.
Figure 1 shows the main window for the management of scripts using an “explorer” like
interface, which should be familiar to most Microsoft Windows users. It presents a view of
scripts organized within folders and stored in the TestManager database. This guide
-4-
discusses the detail of creating, editing, validating and executing scripts, however there are
several concepts and program features that need to be introduced first.
Please note: This document discusses how to control set-top boxes (STBs) with
TestManager, however any type of audio-visual equipment that uses IR remote control can
be used in the place of STBs.
The TestManager application (multi-user mode) uses a typical client-server architecture; the
server being the database and the client application running on one or more PCs. In
addition, the test setup requires one or more pieces of RedRat hardware (irNetBox or
RedRat3) configured to control the equipment under test as shown in Figure 2. The elements
of the setup are:
Test Farm: The set-top boxes or other consumer electronics equipment under test.
irNetBox (or RedRat3): RedRat hardware that sends infrared remote control signals to
control the equipment under test.
TestManager Database: Holds all configuration and user data for the TestManager
application. This is typically installed on the test room PC, but it can be installed on any
suitable computer. It uses the MSDE database engine from Microsoft, which is basically
a desktop version of SQL Server.
-5-
Test Room PC: The computer in the test room or near the equipment under test. In each
installation, only one PC is able to actually execute the tests so as to prevent multiple
concurrent tests being executed simultaneously.
User PC: Any other PC on the network that has the TestManager application installed and
that can access the TestManager database. Test scripts can be setup and verified on
user PCs, but not executed.
Zones: A subset of the full test farm for the case that tests are to be run on just certain
pieces of the available equipment.
TestManager in single user mode (as shown in Figure 3) has the database stored in a file on
the computer on which it runs. This makes installation somewhat easier, but makes the
sharing of scripts more difficult.
3. TestManager Roles
There are two roles when using TestManager in multi-user mode: Administrator and User.
The administrator is responsible for installing the irNetBoxes, connecting them to the STBs
under test and then configuring TestManager so that it knows the mapping from irNetBox
output to STB. Generally, this need only be done once, however the addition or removal of
any STBs will require changes to the configuration. Regular backups of the TestManager
-6-
database are also the responsibility of the administrator. Please see the TestManager
Administration Guide for administration details.
Users can create, validate and execute run test scripts, but do not usually have permission to
change the test configuration.
In single-user mode, the user has both Administrator and User permissions.
When the on-screen remote is moved around the screen, it will “stick” to the edge of the
screen, which also prevents it being moved beyond the screen edge. In some situations this
behaviour may not be wanted and so can be disabled in the Options dialog box (Edit
Options menu item and Misc tab).
-7-
Clicking on the buttons will cause output of the associated remote control signal to all set-
top boxes known to the system by default. If the IR signal associated with a remote control
button is not correctly named (E.g. ‘Select’ instead of ‘OK’) then this can be changed by
someone with TestManager administrator permissions. The section Changing IR Signals
Output via Virtual Remote Control in the Administration Guide provides further
information.
The set of STBs or Zone to which the IR signal is sent when a button is pressed can be
changed by right-clicking on the remote to bring up a context menu supporting the following
options:
-8-
For information about configuring the panel, please see the TestManager Administration
Guide. Once configured, it will show your STBs graphically, similar to that shown in Figure 5.
Clicking on any STB will bring up the on-screen remote control associated with that STB and
TestManager will the route IR commands from that remote control to the selected STB only
(highlighted in red). There are several STB selection modes, and the user can switch between
them by right-clicking to bring up a context menu:
5. Zones
It can be useful in many situations to split a test facility into different zones, for example
some operations may fail on a few STBs so they need to be tested in more detail on these
few or the test facility may support several testers working at the same time on STB subsets.
-9-
Figure 6. The zone editor.
The zone editor, shown in Figure 6 is opened from the View Zones... menu item. When a
zone is created or edited, a dialog box listing all STBs is shown, allowing the user to add and
remove STBs to create the required subset.
Please Note: It is possible to delete zones even though they may be used in scripts.
Therefore, only delete zones if it is definitely known that the zone is no longer required.
6. IR Signal Datasets
The list of IR signal datasets contained within the TestManager database can be viewed from
the View Signal Datasets… menu item as shown in Figure 7.
Each entry in the main view represents the IR signal data captured from one remote control,
and if clicked will open to reveal the individual signals for that remote. It does not support
addition or editing of the signal datasets.
- 10 -
Figure 7. Signal dataset viewer.
- 11 -
7. Macros
A macro is a sequence of IR signals that causes some discrete operation to happen on an
STB. These are frequently used when changing to a certain channel as most STBs require a
two or three digit number to be transmitted, i.e. two or three discrete IR signals.
Figure 9 shows the macro editor which is opened from the View Macros… menu item
with macros on the left-hand side and the sequence of IR signals on the right hand side. The
example macro shown is the IR signal sequence to turn a UK NTL set-top box to BBC1, i.e.
sending the signal sequence 1, 0, 1.
- 12 -
Once complete the macro can be tested using the Test button. TestManager needs to know
to which STBs to send the macro, so an STB selection dialog will be shown so that one or
more can be chosen.
8. Named Operations
The principle behind named operations is that there are operations with clearly
understandable name (e.g. change channel to BBC2) but which require different sequences
of IR signals for different STBs. They build on the concept of macros, but have one additional
level of abstraction so require additional configuration steps. Once configured, the output of
a named operation to a set of STBs will cause them all to perform the same operation, for
example, the named operation BBC2 will switch all STBs to channel BBC2 regardless of the
sequence of IR signals required to accomplish this. Figure 11 shows the named operation
editor with the BBC2 named operation selected. For each named operation, all STBs are
listed in the right hand pane with an associated macro. When the named operation is
executed, TestManager iterates through the list of STBs, extracts the macro for that STB
then sends it to that STB.
To make the configuration process somewhat easier, it is assumed that each named
operation has a default macro (BBC2-Std in the example shown), however for STBs requiring
a different sequence a different macro can be set (e.g. BBC2-NTL for the one of the STBs). To
set a different macro for an STB, right-click on the STB and a select a macro. The right-click
context menu can also be used to set an STB back to the default macro.
Named operations can be tested in a similar way to macros using the Test button.
- 13 -
Figure 11. The named operation editor.
• When sending IR commands to the RedRat3, the user must make sure that these
commands are not directly received by the STBs, so the RedRat3 and remote control
must be shielded.
Configuration is done in the options dialog (Edit Options Control Via Remote tab). Here
the RedRat3 for IR input is selected, and the IR signal dataset that corresponds to the
physical handset to be used. If the RedRat3 does not appear in the drop-down list, then it is
not yet “known” by the system, so needs to be added using the RedRat Hardware
Configuration dialog (Edit Configure RedRat Hardware… menu item).
It is possible to select multiple IR datasets to use to decode input from remote control
handsets if more than one handset is to be used. Using many IR datasets for decoding can
potentially reduce the accuracy of decoding, so it is recommended that only one or two be
used.
- 14 -
To start control via your remote control handset, open the control dialog (as shown in Figure
12) from the View Control STBs via Remote… menu item.
Figure 12. Window used to control STBs with a remote control handset.
Firstly, select which STBs are to be controlled using one of the options in the Target STB
Selection drop-down list. The choices here are;
All STBs – IR commands will be sent to all STBs known by the system.
Select from STB List – Shows the standard STB selection dialog, allowing selection of
any combination of STBs.
Select from STB Layout window – This pops up the STB Layout window (see section
4.2), and either single or multiple STBs can be selected here. Clicking on a STB will
not bring up an on-screen remote control when the STB Layout window is accessed
in this way.
Zones – All zones are listed here, so can be selected. See section 5 for more details
on zones.
- 15 -
Once the set of STBs to control has been selected, IR input can be enabled with the “Start IR
Input” button, which instructs the RedRat3 to start sending IR data to TestManager for
interpretation and output to the selected STBs.
The Remote Control Input window reports input commands, and whether the corresponding
command has been successfully sent to all STBs. This information is also stored in the log file
IR-Input.log if file logging is enabled.
More detailed information about exactly which signals are sent, whether the system has
recognized the input signal etc. can be viewed in the log window (from the View Log
Output menu item).
10. Scripts
The features listed in the previous sections are all building blocks to support the simple
creation of scripts. In this section, TestManager scripting will be introduced.
Two script languages are supported; TM Script and Python. Both are edited and managed in
a similar way, but for more detail on Python scripting, please see the TestManager Python
Guide.
10.1.1 Select
Selects the target STBs for the following script operations where a single STB can be chosen,
a zone or the keyword ALL for all devices in the test facility.
Examples:
select humax-pvr
select zone-3
select all
Any send operations following a select will be sent to the subset of STBs selected until a new
select statement is encountered. By default all STBs are selected, i.e. if no select command is
given at the beginning of a script, a select all assumed.
10.1.2 Send
Outputs a signal, macro or named operation to the selected STBs:
- 16 -
send [signal | macro | named_operation]
Examples:
send play
send ‘BBC2 Std’
send BBC2
If a macro or named operation name contains white space, then it has to be surrounded by
either single or double quotation marks.
So how does TestManager know whether a name given in a send command corresponds to a
signal, macro or named operation? This is done through enforcing the following rules:
1. When a macro is named, it may not have the name of any of the pre-configured
signal names.
2. When a named operation is named, it may not take the name of a signal or any
macro.
10.1.3 Wait
Inserts a delay in the execution of a script of a given number of seconds:
wait N
Examples:
wait 1
wait 360
10.1.4 Loops
Blocks of script instructions can be repeated using loop constructs:
loop N
<instruction block>
end loop
where N is a positive whole number. Loops can be nested within loops, forming constructs
as shown in the example below:
loop 3
loop 4
send down
wait 2
end loop
send OK
- 17 -
end loop
If an indefinite test is to be setup, then an INFINITE loop can be created, for example:
loop INFINITE
<instruction block>
end loop
The following example calls two scripts that are found in the same folder as the calling
script. Quotation marks need to be used round script names that contain white space.
call reset
call ‘basic test’
If a script to be called is found in a different folder, the full folder path should be given, as
shown below:
call ‘STBs\basic function\reset’
Logically, the use of the call keyword is identical to inserting that script section within the
calling script. As a result, any send instructions given in the sub-script will be sent to the STBs
most recent selected with the last select command, whether that is in the main script or the
sub-script.
Please Note: It is not recommended that a script calls itself, or that sets of scripts that call
each other in an infinite sequence are setup. The system does not currently check for this,
and the recursive nature of these operations will eventually lead to a stack overflow
exception.
10.1.6 Comments
Comments can be inserted anywhere into scripts using a ‘#’. All text between the # and the
end of the line is treated as a comment.
- 18 -
send BBC1
wait 5
sent red
wait 5
loop 3
loop 4
send down
wait 2
end loop
send OK
end loop
Full details of setting up and using Python is given in the TestManager Python Guide.
- 19 -
For actions 1 and 2, the use of the internal editor or an external editor can be configured in
TestManager options.
Once editing is finished, save the file and close the editor. TestManager will then read back
the file and store it in the database. Note: Don’t save the file under a different name (unless
you are making a backup copy on disk) as TestManager reads back from the same file it
created so will not read back any changes if they are written to a different file.
- 20 -
That the script syntax is correct, e.g. keywords spelt correctly, loop starts and ends
matched up.
STB and zone names recognized.
Signal, macro and named operation names recognized.
For IR signal output instructions (SEND <IR signal>) the particular signal is found in
the datasets for the selected STBs.
Figure 15 shows typical output from validation on a script with errors. A script can be
validated on any PC on which TestManager is installed so that scripts can be created and
validated in preparation for access to the test facility.
Warnings and errors are treated slightly differently (and also printed in different colours). An
error prevents the script from being executed, for example incorrect script syntax, whereas a
warning will not stop the script being executed but it may not produce exactly the desired
effect.
- 21 -
10.3.3 Script Execution
In a standard test facility setup, script execution can usually only take place from the PC
within the test facility. This is to prevent other TestManager users accidentally initiating
script execution from PCs elsewhere on the network, so interfering with the test facility
operation. Multiple scripts can be run simultaneously.
Script execution can be started from the Execute Script toolbar icon or the Script Execute
Script menu item or by right clicking on a script. Before the script is executed, it is validated
and if no errors are found execution will start. In addition, it will reserve all set-top boxes to
be used in the execution of the script so that if another script is started, it cannot use any
reserved STBs, hence will not interfere with script execution.
Figure 16. Script execution output .
shows the script progress dialog box, the main part showing each instruction as it is
executed, including the loops so that script progress can be monitored. The lower part of the
window shows the actual IR output log so that every output IR signal can be tracked,
including IR signals that can’t be output. (See next section for more information on logging.)
The Stop button can be used to prematurely terminate the script’s operation if necessary
and the Hide Log button to hide the bottom section of the window.
- 22 -
Figure 16. Script execution output .
- 23 -
Figure 17. The Script Capture Dialog
Either an on-screen remote control or a RedRat3 device can be selected as the input
method, and if a RedRat3 if chosen, then an IR dataset also has to be selected. This IR
dataset is used for input signal recognition so that the appropriate remote control button
presses can be inserted into the script.
Using the On-Screen Remote: If the on-screen remote is being used for script capture, it can
also be used to simultaneously output IR signals so that the result of the buttons presses are
seen in real-time. To select which physical STBs/TVs you would like to control, right-click on
the on-screen remote and select either a Zone, a set of STBs or all STBs. The “No IR Output”
menu item can be used to turn off any IR output if it is no longer required.
If it becomes unclear which IR signals are being sent, then the log window can be opened
from the View Log Output menu item. All output signals will be reported, and also any
problems such as certain IR signal data or RedRat hardware not being available.
- 24 -
A Note on IR Signal Recognition via a RedRat3: Due to the large variation in IR signal types,
not all IR signal datasets are reliably recognized by the general purpose signal recognition
algorithm built into TestManager. If in doubt, it may be worth experimenting with the Signal
Database Utility which gives direct feedback when IR signals are detected by the RedRat3.
Please contact RedRat support for further details or the development of custom signal
recognition code if your remote control is not recognized by the general purpose signal
recognition algorithm.
If you suspect that IR signals are not being recognized, open the log output window (View
Log Output menu item) as this will print out each IR signal that is not recognized.
While a script is being captured, a timer counts the number of seconds between each button
press and inserts the given pause into the script. The running timer value is shown in the
status bar at the bottom of the window.
If the Log script execution and other output to file option is checked in the Options dialog
then application log output is sent to a file called TestManagerAppLog.Log in the log
directory.
- 25 -
sequence of operations. As shown above, the log output can be viewed with script
execution, but it can also be sent to a file as well.
File logging is configured from the Logging tab in the options dialog box, from the Edit
Options… menu. If file logging is enabled, then a directory for the log files needs to be set in
which TestManager will write the log files. The log output from each script executed is
written to a file with the same name as the script, and in a directory structure that exactly
reflects the TestManager script folder structure.
Each entry in a log file is given a time stamp, producing output similar to that shown below:
If a script is re-executed, then the log file is overwritten, so deleting the output from any
previous runs.
A running TestManager instance is required; following which one of the above exes can be
called by a third party application on the same PC with appropriate parameters. It then
communicates with TestManager, and initiates the execution of a script.
- 26 -
12.1 TMSendCommand.exe
This is a console based application, the advantage being that it can provide output from its
operations and so give feedback as to whether it has successfully passed the commands to a
TestManager instance. It is therefore recommended that this application is used for initial
experimentation.
will execute the script called Interactive Page1 given in the Sport\Football folder.
(N.B. The Script Folders root folder name can be ignored in the full script path name.)
12.1.2 –verbose
TMSendCommand.exe will print out each step of its operation, and whether it has
successfully sent the command to TestManager. TMSendCommand does receive any
feedback from TestManager itself, so to check that TestManager has received a valid script
name, and that it can execute the script, enable the log output window from the menu item
View Log Output in TestManager.
12.1.3 –help
This will print out the various TMSendCommand options available.
4. Select a script to execute, add it as a parameter with the –script option to the
TMSendCommand command line, also including the –verbose option. For example
(on a single line):
TMSendCommand.exe -script Sport\Football\Interactive Page1
-verbose
If all goes well, you will get TMSendCommand output similar to the following:
- 27 -
INFO: Found TestManager application.
INFO: Sent EXECUTE_SCRIPT to TestManager:
Sport\Football\Script2
12.3 TMSendCommandW.exe
The TMSendCommand.exe application is a console application, meaning that it is run from a
console window (sometimes called DOS or command windows). If it is executed by another
means, for example clicking on it in Windows Explorer, then a console window will be
started. This also applies when running it from third party applications.
As TMSendCommandW.exe does not use console output, and does not create any windows,
it does not provide any feedback to the success or otherwise of its execution. Therefore it is
recommended that the console version is used to experiment and get the command line
parameters correct before using TMSendCommandW.exe.
- 28 -
13. TestManager Options
These control various aspects of TestManager and can be seen in from the Edit -> Options
menu item. They have been described where appropriate in the various sections of the
document, but they are all listed here.
Use internal database: If checked, a local file based database is used for storage, only
accessible from the application running on the local machine. This is easier for installation
but does not support multiple-users.
Server name: If an external database is used, this is the name of the database server.
Default Script Editor: When double-clicking on a script or using the Edit Script icon, it can be
configured as to whether the internal or an external editor is used.
External Python Editor: The external application used for editing Python scripts, plus any
command line arguments needed when starting the editor. There is also an option to save
the user’s preference regarding whether to open Python scripts externally in multiple-
document-interface (MDI) mode or not.
External TM Script Editor: The external application for TM Script editing, plus command line
arguments. The option of opening scripts externally in MDI mode is also available for TM
scripts.
Use On-Screen Remote for Input: Clicking buttons on the on-screen remote control will
insert these commands into the script.
User RedRat3 for Input: Select the RedRat3 device to be used for IR input. When the remote
control handset is used, these commands are inserted into the script.
- 29 -
Dataset for IR Signal Matching: To recognize the IR signals from the remote control handset,
the correct dataset needs to be set here.
Log script execution output to file: Allows selection of a directory into which TestManager
will write log files. The name of the output file is the same as the script.
Log script execution to socket: Sets the IP address and port number for a log listening
application.
On-screen Remote for STB Layout Window: STBs shown in the STB Layout window (section
4.2) can have an on-screen remote control associated with them, however if multiple STBs
are selected with different remote controls, which one should be used? This sets the default
on-screen remote to use.
irNetBox Auto Disconnect on Idle: If TestManager does not send any commands to an
irNetBox within a certain period of time, it can be instructed to disconnect from the irNetBox
so that another user can access it. By default this is switched OFF, but it can be enabled
here, and the idle time before disconnect set.
Enforce Single STB User: By default, TestManager will ensure that if a script is controlling an
STB, then no other script can use it. It will also prevent control of STBs via any other
mechanism, such as on-screen remote controls. There may be circumstances when it is
useful to be able to control STBs simultaneously automatically via scripts and manually via
on-screen remote controls, so this box should be un-checked.
- 30 -