1. Script Recorder Overview
Script Recorder records your interaction with the connected system into a script the active editor. It provides what is often called the "Record & Replay" feature. It records the following event types:
- Mouse or touch events such as moves, clicks (taps), drags and mouse wheel events,
- Keyboard events, which represent keys or combination of keys pressed on the keyboard
Up to version 4.0 the recorder created coordinate based code. The Component Capture had to be used in places where search for a component on the screen was required before applying the mouse action to it.
Version 4.1 delivered a new recorder which produces reliable image based testing code. It saves component images on the fly and generates code relying on commands that combine image search with a mouse action, such as the Click and Drag ones. This results in highly reliable scripts tolerant to changes in the application location on the screen. The Component Capture can be still used to produce code of a customized action.
Script recording is supported on the following environments:
- Recording on the Local Desktop connection is supported on MS Windows 2000 or newer (since v3.5) and Linux (both since 4.1). Mac OS X is also supported since 4.1 as long as Access for Assistive Devices is enabled in the system (instructions).
- There are no limitations for other connections.
2. Recording Principles
This is a brief description of the recorder functionality. For a detailed walk through see the online T-Plan Robot Enterprise Advanced Recorder document.
To start/stop script recording select/deselect Script -> Record in the main GUI menu or the button on the tool bar. You must be connected to a desktop and have a project and a script open in order to do it.
The recorder converts the user actions into commands of the scripting language (when the target script is a TPR one) or method calls of the Java Script API. The resulting code is always inserted into current caret position of the active editor. If there's already a command on the line, the recorder creates a new line below the current one.
The recorder supports three recording modes:
- Interactive Mode will pause on every recordable mouse action to allow you to customize the generated code and image(s). You may enter name of the image collection, adjust the image crop area and/or choose to produce the action code through Component Capture. This mode is supported for all connection types except for the Local Desktop one.
- Rapid Mode will record the code and images using the default settings without asking any questions. The Robot GUI remains hidden during the whole session. As the screen analysis is time consuming please avoid fast desktop actions and perform your scenario at a slow pace. To finish recording press the right Alt or Ctrl key. After the session is finished you will be given a chance to customize the code and images. This mode is supported for all connection types.
- Legacy Mode will switch to the legacy coordinate based recording known from the 2.x, 3.x and 4.0 versions.
- The script recorder internally caches a few seconds of the screen history. As this is CPU and memory intensive don't be surprised to see increased memory usage.
- Component images are saved to image collections in the default project template folder. If there's no project the collections are saved to the user home folder.
- The recorder analyzes the screen and chooses the best component image crop area on every mouse click or drag. You may customize it right away (Interactive mode) or at the end of the session (Rapid mode).
- If there's a component which changes on mouse over, such as a highlighting button, the recorder should detect it and save two or even more template images of the component states to the target collection.
- NOTE: Starting with 4.1.1 this feature is disabled by default for work on a better detection algorithm. The recorder always creates only one image. The feature may be re-enabled in the Script Recorder Preferences.
- The present version always creates new component image(s) on every applicable mouse action. It does not search the existing collections to check whether the component image already exists or not. This must be done manually. Future releases are likely to deliver improvements in this area.