Command Summary
T-Plan Robot contains a number commands spanning a variety of purposes. Below we provide a brief summary of each command, in alphabetical order, with a link through to more information.
Some of the most popular or commonly used commands are:
Report - ensures that each execution generates and output report.
Click image/ocr/object - visually search for an item on the screen and click on it if found.
Browser open/find - object recognition for web automation.
Mobile find - object recognition for mobile device automation.
Screenshot - capture a live screenshot
Type or Paste - pass a text string to be typed into the target system.
If/else - dynamically branch behaviour based on any given criteria.
For - loop any number of times/values or until a condition has been met.
Var/Varg - define custom variables for use across your script executions
Procedure - create reusable pieces of code to help streamline your scripts.
| Category | Command | Description | ||
A | An alert window pops up on your local machine. The window can be customized to include custom buttons and editable fields. It can also be automatically discarded after a specified timeout. | ||||
B | Immediately exit the innermost 'for' loop and proceed to the first command after the right curly curly brace '}' surrounding the loop. If the command is used outside of the for loop, a syntax error is reported. To skip the current loop without interrupting the 'for' command, use the continue command. | ||||
Automate web browsers, via Selenium drivers, using web element object identification. (not image based). | |||||
| Open the web browser of your choice and load the specified web page. The browser can be either a local browser or a remote browser (supported by Selenium Grid, 6.3 or later). In version 8 and later, you can also open a new tab or window with this command. | ||||
Search for elements on the web page according to the specified object criteria and apply optional actions (click, type, submit, clear). | |||||
Switch between browser tabs and windows. Supported in v8 and later. | |||||
Close the tab, window, or entire browser and finally end the Selenium session. | |||||
C | Immediately perform a single search of the connected SUT using any of the available search methods (image, text, object, AI, etc) | ||||
Connect to your target SUA (system under automation). | |||||
Skip iterations of the current innermost for loop. If the command is used outside of the 'for' loop, a syntax error is reported. To interrupt (terminate) the entire 'for' loop, use the break command. | |||||
Wait for an item to appear before then clicking it. | |||||
D | It reads, writes, and calculates dates. This command allows you to retrieve the current date, parse the entered date, optionally perform a time increase or decrease operation, and save the results in a _DATE variable in the specified format or in a specified custom variable. | ||||
Disconnect from the SUA. When the connection is closed, the predefined variables _MACHINE and _DISPLAY are cleared. | |||||
Locate the start and end points of a mouse drag action through any of the available search methods, or via a relative distance. If either of the searches fail, exit the script. | |||||
E | Define script variables whose values are evaluated as numeric expressions. For more information, see the chapter on numerical formulas. Other behaviour is exactly the same as the var command. | ||||
Run OS commands on your local system (the machine running T-Plan Robot). The argument must be a single command (e.g., 'ls -l' on Unix/Linux). Due to the limitations of the interface between Java and the underlying OS, commands do not allow pipes and redirects of output. If you need to save the output to a file, use the outfile parameter. If you need to use a pipe or redirect, place the command in a shell script or batch file and call it with an Exec command instead. | |||||
Terminate a script, procedure, or structured block of code and return an exit code. | |||||
Read, write and search Microsoft Excel files (.xls, .xlsx, xlsm). | |||||
Opens an existing Excel document in read/write mode. | |||||
Create a new Excel document and/or create a sheet. | |||||
Select a sheet and/or select a cell and retrieve its value and format. | |||||
Search the selected sheet for a cell by its value or a regular expression. | |||||
Set sheet name or cell value (format). | |||||
Mark cells for copying. | |||||
Paste cells marked with Copy into an Excel document. | |||||
Close and save the Excel document. | |||||
F | Reading from and/or writing to text files. You can use this command to open or create plain text files, read/write text, search for strings/regular expressions, and parse values from individual text lines using comma-separated values (CSV) format or regular expressions. | ||||
Design a loop to iterate over a range of values or based on a specified condition. | |||||
G | Design and execute touch screen gestures. It is only supported on mobile device connections such as: Android via ADB, iOS via Xcode | ||||
Record finger presses at the specified location in the gesture buffer. | |||||
Records the movement (drag) of the specified finger to a new location. | |||||
Record the release of the specified finger. | |||||
Save the gesture with the given name and clear the gesture buffer. | |||||
Perform gestures on connected devices to clear gesture buffers. | |||||
Clear the gesture buffer and get ready to design new gestures | |||||
I | Use the if/else commands to dynamically branch execution flows based on given values. | ||||
The Image Doctor wizard can help you identify and resolve image comparison failures in executed scripts. This is especially useful if your application or System Under Automation (SUA) changes and you need to update your image comparison code or template images. The wizard consists of three elements: Image Doctor's warning pop-up window allows you to interactively resolve image comparisons. The Image Doctor Records feature records failed image comparisons in automated (unattended) mode for later resolution. | |||||
Include another script or compiled Java code. | |||||
J | Create a native Java code block directly within your TPR script to leverage the full power of Java capabilities. | ||||
L | Log the message in the script execution log file. | ||||
M | It is a combination of the Waitfor match and Mouse move commands. Search for component images, solid colour objects, or text on your desktop, and hover your mouse pointer there. If the object is not found, exit the script. | ||||
Get incoming mail from an IMAP or POP3 server. To send an email through an SMTP server, use the Sendmail command. | |||||
| Download the email from the server. Messages can optionally be filtered by attributes. | ||||
Set the SEEN flag for the message. | |||||
Delete one or more messages on the server. | |||||
Run a mouse event. This command can automate various mouse actions, such as moving the mouse pointer, clicking, pressing, releasing it, dragging, and mouse wheel events. This command also supports custom dragging, which consists of a sequence of mouse press, mouse movement, and mouse release events (starting in 2.0.2). If the configured events (click, drag) fail, check the adjustment parameters in the mouse command settings. | |||||
| Mouse click | Perform one or more clicks at the target point using the specified mouse button | |||
Mouse drag | Use the designated mouse button to drag the mouse from any destination to the target point. | ||||
Mouse move | Move the mouse pointer from any destination to the target point. | ||||
Mouse pinch | It is one or more pinch events that move two fingers toward a common center point on the touch screen (also known as a "pinch close"). This event is only supported in certain environments, such as Apple iOS devices running T-Plan Server connected with the iOS mirror connection type. | ||||
Mouse press | Press the mouse button (without releasing it) | ||||
Mouse release | Mouse button release (logically requires a preceding 'press' event) | ||||
Mouse swipe | A mouse drag with adjusted timing for devices with a touch display (such as Android or iOS devices), | ||||
Mouse wheeldown | Rotate the mouse wheel upwards for at least one turn (the wheel rotates away from the user) | ||||
Mouse wheelup | Rotate the mouse wheel downwards at least once (rotate the wheel towards the user) | ||||
Mouse zoom | Zoom in on the screen. If your current connection supports pinch, expand your current application. This command uses a custom center point and start and end distance. | ||||
It provides mobile-specific functionality with Android Over ADB and iOS Over Xcode connectivity. | |||||
Alert processing | |||||
Get your current app ID | |||||
Find and action UI elements through object recognition | |||||
Install apps on your device | |||||
Keyboard Controls | |||||
Force quit an app on your device | |||||
Handling screen orientation | |||||
Download files from your device | |||||
Upload files to your device | |||||
Run shell commands against your device | |||||
Launch the app on your device | |||||
Uninstall apps from your device | |||||
P | Use the system clipboard to paste (insert) text. Instead of typing text on the keyboard one letter at a time, this command simulates copying the text to the clipboard and pressing Ctrl+V (Command+V on Mac OS X) to trigger the system's paste action. This is much faster than typing text in Type/Typeline. | ||||
Pause the script execution. When the T-Plan Robot is running in GUI mode, the Pause button/menu item is selected and the user can deselect the button or menu item to resume the run. | |||||
Send the key to the desktop. It's the same as pressing a key on a keyboard. | |||||
Create reusable pieces of code to streamline your scripts. Procedures can accept numbered variable inputs defined as part of the procedure call. | |||||
R | Create and launch a reporting provider for the scripts that have been executed. This is an object that creates reports from script execution data, such as results, screenshots, and warnings. | ||||
Execute another local TPR script, Java script or Java class. Data and variables and reports generated by executed scripts become available to the calling script also. | |||||
S | Take a screenshot of your current remote desktop and save it to a file. | ||||
Define the start or end of the script (test case). This command was introduced as part of its integration with T-Plan Professional, but it can be used generally to define scripting structures that are common in the QA industry. Script mappings are recognized by enterprise reporting providers and can be used to map output XML data (or HTML reports) to QA documents (such as test case specifications). | |||||
Send an email. This command acts as an SMTP client and sends emails with attachments through the SMTP server. To receive an email, use the Mail command. | |||||
Define the results of the test step. A step represents a single atomic instruction in a test case (script). The steps must be placed within the script block. | |||||
Parse or process complex text strings using a one or more String operation. | |||||
| Locate the position of the first match to the value supplied in the "string=" parameter. | ||||
Returns the length of the text (number of characters). For example, "String length "Demo" sets the _STRING variable to 4. | |||||
Matches the text to the java.util.regex.Pattern-compliant regular expression specified in the 'pattern' parameter to produce a Boolean result ('true' or 'false'). | |||||
Returns a new text that replaces all occurrences of the values specified in the 'string' parameter in the text with the string specified by the 'replacement' parameter. | |||||
Split the text into a set of strings that match the specified string ('string' parameter) or java.util.regex.Pattern regular expression ('pattern'). | |||||
Returns a substring of text defined by the entered "start" and/or "end" index number. | |||||
Create new text from one or more numeric ASCII or Unicode values separated by semicolons. | |||||
Remove all leading and trailing spaces (spaces, newline characters, etc.). | |||||
T | Manage timer and timer groups. Timers allow you to measure the elapsed time of commands, command blocks, or scripts, typically for performance testing purposes. | ||||
Type text on your desktop. The Typeline command is a useful command that simply involves typing text and pressing Enter. This has the same effect as the combination of 'Type <text>' and 'Press Enter'. | |||||
V | Define standard variables for use throughout your script. | ||||
Define formatted variables that can contain a Java escape sequence that allows you to insert new lines, tabs, or special Unicode characters into the value. | |||||
Define ("Varg set") or delete ("Varg delete") global variables with a specified visibility scope, allowing to share data across scripts & workitems. | |||||
Varg set | Varg set name="S" value="Hello" scope="session" - Create or set a session variable called "S" | ||||
Varg delete | Varg delete name="S" scope="session" - Deletes the session variable created in the previous example. Leave all other variables with the same name that exist locally or in the script scope. | ||||
W | Wait for the specified time. Use this command to pause the script from running for a specified period of time. | ||||
Insert a warning into the report. Warnings can be associated with specific screenshots through image parameters. Such warnings appear below the image description in the report. If there are no associated images, the alert appears in the report as a single component. | |||||
Pause the script execution and wait for the RFB event or the state of the remote desktop image. | |||||
| Indicates that the server has beeped. This indicates that the application has output a bell character (ASCII 0x07). | ||||
Wait for the remote server's clipboard content to be delivered, then available through the "_SERVER_CLIPBOARD_CONTENT" variable. | |||||
The event will cause the command to wait until the selected comparison method produces a positive result (until the desktop matches). | |||||
Wait until the search can no longer find a match to the item on the screen. | |||||
Wait for the remote system display to update/change. |