Script Recording


Script recording is a feature introduced for the first time in VNCRobot 1.2. It allows you to record everything you do in the VNC viewer to the active editor and easily create automated testing scripts.

To start/stop script recording select/deselect Script -> Record in the VNCRobot menu or the button on the tool bar.

Component which provides this feature is called Recording Module. It is capable to capture and record user actions such as:
The following chapters describe functionality of the recording module and discuss how to configure and customize its behavior.

General Rules

The recording module maps the key and mouse events as well as their timeline onto commands of the VNCRobot 1.3 scripting language. Commands are always inserted into current caret position of the active editor.

Time spans between single commands are captured through the 'wait' command parameters or Wait commands where the parameter is not supported. If you e.g. perform a mouse click while the recording feature is on, a command like the one below appears in your active editor:

Mouse click to=x:253,y:132

Wait a while and perform another mouse click. The code will look like this:

Mouse click to=x:253,y:132 wait=3400
Mouse click to=x:355,y:144


Note that the first command was updated with the 'wait' parameter. Its value represents the time elapsed between the mouse clicks in miliseconds. When the preceding command doesn't support the 'wait' parameter (e.g. Screenshot or Report commands), the recording module rather produces a Wait command:

Screenshot init.jpg desc="Initial remote desktop state."
Wait 3400
Mouse click to=x:253,y:132

Preceding Waitfor commands are never updated this way because their 'wait' parameters may be related to multiple updates. See the Waitfor Command Window page for more information.

To track the time spans the module maintains a timer which measures time from the last user action (i.e. from the last time it inserted or updated a command in the editor). This timer runs only if the VNC viewer is active, i.e. your mouse pointer is within its bounds. If you move your mouse pointer out of the remote desktop, the timer stops and it won't start ticking until you move the mouse pointer into its bounds again. This feature allows to exclude the time you spend on other tasks like manual script editing and using of other tools. Remember to move your mouse pointer out of the remote desktop if you are going to do something else to prevent the module from introducing of large wait times into the script commands.

Mouse Event Recording

Mouse pointer events are recorded as follows:
Recording of each of the mouse event types described above can be disabled in the Preferences window. See the following screenshot. If you want e.g. to have a shorter and simpler test script code, you can disable recording of the mouse move events. You must then avoid any desktop actions which are triggered by mouse moves. A typical example is the Start menu in MS Windows which displays submenus depending on mouse moves. Such actions will not record if mouse moves are disabled and your script will fail to reproduce the required behavior.



Keyboard Event Recording

Keyboard events are recorded as follows:
All parameters described above are configurable in the Preferences window. See the following screenshot.