![]() |
T-Plan Robot Enterprise Doc Collection |
1 August 2013 |
scriptstarter-src.zip
file and it
is free for use and reuse by the T-Plan Robot Enterprise customers.
java
call in the ALTERNATIVE 2 below
must be replaced with a full path, for example "C:\Program
Files\Java\jdk1.6.0_<version>\bin\java"
.cd
) to the Robot's install directory and
run it from there.scriptstarter.bat
(MS
Windows) or scriptstarter.sh
(Linux, Unix &
Mac OS) file to allow you to call the tool from any location:
- Replace
robot.jar
in the starting command with a full path to the file.- Replace
scriptstarter.jar
in the starting command with a full path to the file.For example, if Robot is installed under
C:\Program Files\T-Plan\Robot
on MS Windows and you unzipped the tool toC:\ScriptStarter
the start command will look like:
java -Xmx512m -cp
C:\ScriptStarter\
scriptstarter.jar;"
C:\Program Files\T-Plan\Robot\
robot.jar" StartScripts %1 %2 %3 %4 %5 %6 %7 %8 %9
The Java command from the
.bat
or .sh
file may be naturally executed directly from a command prompt
(terminal) or from a 3rd party application, for example from a
scheduler. The-Xmx512m
parameter defines how much
memory the tool (and also Robot) may use at a maximum. In
this case it is 512 MB. For larger deployments with a higher number
of test scripts executed in parallel it is recommended to raise the
limit to prevent the tool from running out of memory. Principles of
the memory optimization are described in the Optimizing
Performance chapter of the Robot's Release Notes document.The test scripts to be started must be specified through a plain
text file. Empty lines and lines starting with # will be ignored.
Other lines must specify CLI parameters of a single T-Plan Robot
process. For a complete list of supported CLI options see the CLI
Reference document.
For example, the following text file will execute the
Script1.tpr
and Script2.tpr
test
scripts in parallel on two different VNC environments:
# Start Script1.tpr on VNC server at
rfb://192.168.100.7:5900
-c rfb://192.168.100.7:5900 -r
C:\MyProject\tpr\Script1.tpr -n
# Start Script2.tpr on another VNC server at
rfb://192.168.100.11:5900
-c rfb://192.168.100.11:5900 -r
C:\MyProject\tpr\Script2.tpr -n
Each script line must contain at least the -r/--run
parameter to define the script to be executed. The line may
optionally call the -c/--connect
option to make the process connect to the specified SUT prior to
starting the script. The script itself may alternatively establish
the connection through a call of the Connect
command (TPR test scripts) or the connect()
method (Java test scripts). It is not recommended to use both the
ways at a time for performance reasons because the connection will
be established twice.-v/--variable
switch. For example, the following two lines will start the same
script on two different environments where each process will get a
different set of values:As parallel execution is not supported by the GUI, the scripts will be always executed in the CLI mode regardless of whether the lines specify the-c rfb://192.168.100.7:5900 -r C:\MyProject\tpr\Script1.tpr -n -v "DATAFILE=C:\My Data\data1.xls" -v "MODE=
modeA"
-c rfb://192.168.100.11:5900 -r C:\MyProject\tpr\Script1.tpr -n -v "
DATAFILE
=C:\My Data\data2.xls" -v "MODE=modeB"
-n
/--nodisplay
option or not. The example above lists the option for clarity. scriptstarter.bat
(MS
Windows) or scriptstarter.sh
(Linux, Unix & Mac
OS) file and pass it the text file as an argument. Unless you
updated the file as is described in the ALTERNATIVE
2 above you will have to change to the install directory and
run it from there. MS Windows:
scriptstarter.bat <text_file>
Linux, Unix & Mac OS:
./scriptstarter.sh <text_file>
For example, to start the scripts in the example file above
stored as C:\My Data\scripts.txt
on MS Windows
one would execute:
scriptstarter.bat "
C:\My Data\scripts.txt
"
Be aware that parallel script execution requires you to have a license key with multiple seats and/or multiple valid keys. If the number of executed processes exceeds the number of licensed seats Robot will put the outstanding processes on hold until the other process(es) finish.