The Tool Panel is the tabbed view situated at the top left corner of the T-Plan Robot Enterprise window. It consists of five tabs:
- The Projects help topic. Project tab displays details of the current project. This component is described in its own
- The Paths tab (known as the "Settings" tab in the 2.x releases) configures I/O settings of the current script (the one displayed in the editor below the tab). The tab is not visible when no script is opened.
- The Variables tab displays the table of compilation and execution variables of the current script. The tab is not visible when no script is opened.
- The Compiler tab provides a list of errors produced by the last compilation of the current script. The tab is not visible when no script is opened.
- The Execution Log help topic. The tab is not visible if no script is opened and there are no execution logs (no script has been executed since the application start). Exec Log tab is a cumulative view of script execution logs. This component is described in its own
Compared to the 2.x releases:
- The Events tab supporting construction of the Waitfor update calls was removed. As testing of a screen update is not reliable across VNC servers from different vendors, the Image Comparison using the "search2" and "search" has become the preferred way of verifying the screen contents.
- The Keys tab was replaced with the Keyboard Tool wizard.
2. Paths Tab
This tab works closely with the script in the active editor. Its controls correspond to commands in the script and any change will be also reflected in the script content:
- The Output Path is a directory where screenshots, reports and other output files resulting from the script execution will be saved to. A change of the path will update the _REPORT_DIR variable in the current script. The drop-down offers the following options:
Create a unique project report (output) path for each script execution. The script outputs will be redirected to a new folder of <project_home>/reports/<script_file_name>_<time_stamp> where the timestamp is the execution (compilation) start time in milliseconds elapsed since 1 January 1970. See the Projects help topic for details. IMPORTANT: Starting with v4.0 this is the default option when the global path is not set. Any project located script that does not set the _REPORT_DIR variable will output by default to a unique project report path. Versions 3.x and older, in this case, fall back to the user home folder.
Redirect the script outputs to the default project folder. This will rewrite the script outputs on each execution. See the Projects help topic for details.
Redirect the script outputs a global path specified in the Language panel of the Preferences window. This option is compatible with the 2.x releases and it is applied when the script code does not make any attempt to modify the _REPORT_DIR variable. IMPORTANT: Setting of the Global path will be saved to the configuration file which will be then loaded by all Robot processes on startup. That's why it will impact all scripts on the machine which do not set the _REPORT_DIR variable explicitly. Use this option with care.
Save the script outputs to a custom path.
- The Template Path is a directory which will be searched for relatively referenced template images and image collections. A change of the path will update the _TEMPLATE_DIR variable in the current script. The drop-down offers the following options:
Project template dir
Resolve relatively referenced template images against the project template path at <project_home>/templates. See the Projects help topic for details. IMPORTANT: Starting with v4.0 this is the default option when the global path is not set. Any project located script that does not set the _TEMPLATE_DIR variable will default to the project template directory. Versions 3.x and older, in this case, fall back to the user home folder.
Resolve relatively referenced template images against a global path specified in the Language panel of the Preferences window. This option is compatible with the 2.x releases and it is applied when the script code does not make any attempt to modify the _TEMPLATE_DIR variable. IMPORTANT: Setting of the Global path will be saved to the configuration file which will be then loaded by all Robot processes on startup. That's why it will impact all scripts on the machine which do not set the _REPORT_DIR variable explicitly. Use this option with care.
Search for template images in a custom path.
- Save results to report inserts a Report command or one of the report() Java methods into the active editor when selected. When the command/method call gets executed it saves the automation results such as script(s), steps, warnings, screenshots and logs to an HTML or XML report file in the specified Output Path.
- Report file defines the report file name. It must have either the ".html" or ".xml" extension. It is highly recommended to use the XML format which more efficient, customizable and it allows to export the results to T-Plan Professional or any other 3rd party tool through an XSL transformation. The XML file can be also viewed in any web browser the same way as an HTML one.
- The Description is optional script description to be displayed in the report header.
When the _REPORT_DIR and/or _TEMPLATE_DIR variables and/or the Report command/method call get manually updated in the editor, the fields of the Settings tab will change as soon as the script gets compiled. If the on-the-fly compilation is switched off the fields will remain out of sync with the script until the script gets compiled or executed.
3. Variables Tab
There are generally three types of variables:
- Predefined variables, sometimes also called implicit ones. Their name typically starts with underscore '_'. These are created by the underlying automation framework for each script compilation or execution.
- Custom variables defined in the script through the Var and Eval commands (TPR scripts) or the getContext().setVariable() method calls (Java scripts).
- Variables created by executed commands or method calls.
The Variables tab contains two independent variable tables:
- The Compilation Variables ("Compilation Vars") tab displays the list of variables defined during the most recent script compilation.
- For TPR scripts the table displays the predefined variables plus any custom variables created through the Var and Eval commands. The value of the custom variables may not match the expected one if it depends on a value resulting from a command execution, such as the File/Excel I/O or image comparison. For example, a compilation of a script loading a value from an Excel file to a variable called CELLVALUE will create the variable in the table but its value will not be correct because the compiler doesn't make any attempts to read the input files.
- For Java scripts, the table displays just predefined variables because the compilation of a Java script doesn't evaluate the setVariable() calls.
- The Execution Variables ("Exec Vars") tab displays the list of variables defined during the most recent script execution. The table will contain a similar variable set as the compilation one plus any variables produced by the executed commands, such as for example by the image comparison or the File/Excel I/O. The execution variables can be also tracked in the XML reports created by the Report command or one of the report() Java methods.
The picture on the left displays an example of the execution variable table of a simple Java script with a variable called MY_VARIABLE. A right-click onto the variable opens up a context menu with the following actions (also available through buttons below the table):
- The "View MY_VARIABLE value" displays a simple window with its value. This allows viewing long and/or multiline values. Viewing of the variable value is also possible through a double click onto the variable.
- The "Copy variable name to the clipboard" menu item (button) will copy the variable name enclosed in curly braces to the system clipboard from where it can be pasted to any other application.
- The "Copy variable name to the active editor" item (button) will copy the variable name enclosed in curly braces to the active editor. This is in fact a variable call and it will be replaced with the actual variable value when the script gets executed.
- The "Copy variable value to the clipboard" item (button) will copy the variable value to the system clipboard.
- The "Copy variable value to the active editor" item (button) will copy the variable value to the active editor.
Variables may have a fixed value through the v/-variable CLI option. Such variables have the '(fixed)' suffix appended to their name. For example, the image on the left displays a fixed variable called MY_FIXED_VARIABLE because the tool was started with the -v "MY_FIXED_VARIABLE=fixed" CLI option. Fixed variables can't be changed in the script and their value remains constant for the whole time of T-Plan Robot execution. If you make an attempt to modify such variable using the Var or Eval command, it will be ignored and no error message or warning will be reported. This mechanism was designed to allow to design parametrized scripts.
4. Compiler Tab
The Compiler tab displays error and warning messages from the most recent compilation of the current script.
- When there are no errors the Compiler tab has the icon and the component reports "No syntax errors".
- When there are errors the Compiler tab displays the icon, the script editor tab has the icon and the component displays the errors in form of a simple tree. The clicking of an error message will make the script editor jump to the corresponding code line.