<a
                  href=http://www.t-plan.com>T-Plan Home</a>
T-Plan Robot Enterprise Plugin Home
16 October 2014

iOS Extension Plugin For T-Plan Robot Enterprise

Contents
1. Overview
2. Plugin installation
3. Usage
    3.1 Start Script
    3.2 Kill Script
4. Troubleshooting

1. Overview

The iOS Extension Plugin adds new features to T-Plan Robot Enterprise test scripts where Robot is hosted on a Mac OS X environment and automates an iOS device connected over the USB cable. It is typically used for automating of applications developed on the same Mac machine.

Versions 1 and 2 support:
Requirements and limitations:
The plugin is primarily designed for test scripts written in the TPR language. To call the plugin scripts from Java either use the DefaultJavaTestScript.run() method or use the script instance approach described in the Java Test Script Basics document.

Should you have any questions or suggestions contact the T-Plan support. For the list of other plugins provided by T-Plan go here.


2. Plugin installation

The plugin requires T-Plan Robot 3.5.2 or higher. To install the plugin download it from:

OPTION 1:

  1. Unzip the file and copy the iosextension.jar file to the plugins/ directory under the Robot installation directory. This will make Robot load the classes on the start up. Make sure to remove any older versions of the plugin.
  2. Start or restart Robot.

OPTION 2:

  1. Unzip the file to a location on your hard drive.
  2. If you plan on using the plugin in the TPR scripts put the following command to the beginning of each test script:
Include "<location>/iosextension.jar"
  1. If you plan on using the plugin in Java test scripts put the iosextension.jar file onto the Java class path.
To uninstall the plugin simply delete the file.


3. Usage

The plugin contains two Java test scripts:
Script Name
Description
com.tplan.ios.Start
Start an application on the iOS device.
com.tplan.ios.Kill Kill the application started previously with Start.

The plugin scripts are to be called from TPR test scripts using the Run command. The command instances may be easily created using the Command Wizard tool. To edit an existing Run command right click it and select Properties in the context menu.

EXAMPLE: Start an application on the iOS device, perform some testing and kill it:

// Presume that iosextension.jar is in the script folder
Include "iosextension.jar"

// Start the MyApp.app application. You may also use the .ipa file.
// We presume that there's just one iOS device attached so we don't
// have to specify the UDID.
Run "com.tplan.ios.Start" file="/Users/robert/Downloads/MyApp.app"

// Wait for a few seconds to ensure that the application starts properly
Wait 5s

// Perform testing here
// ...

// Kill the application
Run "com.tplan.ios.Kill"


3.1 Start Script


DESCRIPTION

The com.tplan.ios.Start script starts the application specified by the file parameter on the iOS device attached over the USB cable or onto the iOS simulator. The application must be already installed on the device.

Device identification:

The script enforces one started application at a time:

Auto shut down:

iOS 8 support:

As the script receives no feedback on the application start completion it is recommended to add a delay (Wait) for a reasonable amount of time after the Start call. Should you experience a failure see the Troubleshooting section for help.

SYNOPSIS (TPR SCRIPTS)
Run com.tplan.ios.Start file=<file>  [udid=<identifier>]

SYNOPSIS (JAVA SCRIPTS)

run("com.tplan.ios.Start", "<file> [, "udid",  "<identifier>"] );

* Red color indicates obligatory parameters

OPTIONS
file=<file>


- Mandatory full path to the application folder (.app) or the AdHoc or Enterprise application archive (.ipa). To find the latest .app build under Xcode open Window->Organizer, select the Projects view, click the target application and open the Derived Data path in Finder. Then navigate to Build->Products and search the Debug-<target> folders for the .app. You may copy it from here to a stable location for automation purposes.

udid=<identifier>
- Optional Unique Device Identifier (UDID) of the device to work with. See instructions on how to get the UDID of your device. When the UDID is not specified the script will connect to the first device returned by the system (the order is not specified). If there's no attached device the script will look for a running iOS simulator.

RETURNS
The command returns 0 (zero) when the application gets started properly. Otherwise it returns 1 (one) or the system exit code. The failure is also logged into the execution log. See the Troubleshooting section for help.

EXAMPLES

See the Usage chapter.


3.2 Kill Script


DESCRIPTION

The com.tplan.ios.Kill kills the application started previously with the com.tplan.ios.Start script. If there's no such application the script does nothing.

SYNOPSIS (TPR SCRIPTS)
Run com.tplan.ios.Kill 

SYNOPSIS (JAVA SCRIPTS)

run("com.tplan.ios.Kill");

* Red color indicates obligatory parameters

OPTIONS:

None.

RETURNS
The command always returns 0 (zero).

EXAMPLES
See the Usage chapter.




4. Troubleshooting

This is the list of often experienced errors and their resolutions.