![]() |
T-Plan Robot Enterprise 4.0.2 Doc Collection |
10/06/15 |
Schedules are physically stored as XML files in the schedules/
folder of your project. As test scripts are referenced through
relative file paths the test suites will remain functional when
the whole project is moved or renamed.
Test suites may be easily created and maintained through the Scheduler
tool. To create a schedule do one of the following:
The blue rectangular object subtitled
"Start settings" represents the top level schedule
object. The "Start Type" property defines how the
test suite should behave when it gets started (see Execute Schedule for start up options):
The Report Details
section allows to configure how the schedule report is created:
To add the first script to the schedule select (click) the top
level schedule object and do one of the following:
The script will appear in the view as a new box titled with the
script file name. You may give it an optional display name. To add
more scripts:
For example, consider testing of a mobile phone application.
There are two test scripts to test it on iOS (iOS.tpr
)
and Android (Android.tpr
). The plan is to execute it
first on an iOS 6 device and when it passes retest it also on iOS
7. Testing on Android will be started in parallel. It will be
first performed on a Samsung S2 device and if it passes it will be
retested on a Samsung S3. The schedule will look as follows:
Each script object allows to specify the CLI options. The supported ones are:![]()
-c/--connect
with the optional -p/--password
one allow to specify the test environment (server or device) to
execute the script on. The above screen shot instructs Robot to
start the script on the Android device of serial number A123456
connected over the Android Over ADB
connection.-v/--variable
set the specified script variable to a fixed value. It allows to
pass execution specific values to the script. The option may be
specified multiple times to set multiple variables.-n/--nodisplay
or
-o/--option
are
accepted only at the level of the Robot start command.
They are then applied to all scripts in the schedule. See the Execute Schedule chapter for details on
schedule execution.Test suites are in general treated the same way as individual
test scripts. They can be started in three ways:
As the GUI is not capable of executing test scripts in parallel it will always execute them sequentially (one at a time). For parallel executions use the CLI or Java API execution mode together with the
-n/--nodisplay
option.-r/--run
CLI option. This will start Robot, execute the schedule and exit.
There are two modes:<
Robot_start_command
> -r <schedule_XML>
-n/--nodisplay
option. It is recommended for production deployments. As it will
not open the GUI it has much lower memory requirements and it is
faster. It is also suitable for executions started remotely over
telnet or ssh. If the schedule contains parallel
scripts they will be started in parallel. The command:<
Robot_start_command
> -n -r <schedule_XML>
-r/--run
option inside
the arguments:Alternatively there's new createAutomatedRunnable(Schedule, String, String[], PrintStream, boolean) method to create a runnable for an existing Schedule instance:public static void main(String args[]) {
ApplicationSupport robot = new ApplicationSupport();
AutomatedRunnable t = robot.createAutomatedRunnable("Example" , new String[] {"-r", "
<path_to_schedule_XML>" }, System.out, true);
new Thread(t).start();
}
public static void main(String args[]) throws ParserConfigurationException, SAXException, IOException {
ApplicationSupport robot = new ApplicationSupport();
com.tplan.robot.scheduler.Schedule schedule = new com.tplan.robot.scheduler.Schedule();
schedule.read(new java.io.File("
<path_to_schedule_XML> "));
AutomatedRunnable t = robot.createAutomatedRunnable(schedule, "Example" , new String[] {}, System.out, true);
new Thread(t).start();
}
Both approaches allow to force the CLI execution mode through putting -n
or --nodisplay
to the list of input arguments:AutomatedRunnable t = robot.createAutomatedRunnable("Example" , new String[] {
"-n",
"-r", "
<path_to_schedule_XML>" }, System.out, true);