Compareto Command Window


This window allows you to create a Compareto command easily via GUI and insert it into the active editor. If the window is opened while the caret is on an already existing Compareto command in the active editor, it allows to edit the command. See the Compareto command specification for more information on fields and values defined in the window. To open the window either select Script -> Compareto Command or click on the corresponding toolbar button in the VNCRobot menu. To edit an existing command perform a right mouse click on the command in the editor and select "Properties" in the context popup menu.

The major window component, the Template Properties panel, is also used in the Waitfor Command Window and Screenshot Command Windows dialogs. See also the Image Comparison With VNCRobot 1.3 document for more information about image comparison with VNCRobot.

Compareto Command Window

The two buttons on the top allow you to select the dialog mode:
  1. If you select the "Create a new template..." button, the window will let you create a new template image based on the current remote desktop image.
  2. If you select "Use an existing template image", you will be able to select an already existing template image and eventually edit it. This mode should be selected automatically when you open the window for an already existing Compareto command.
The image operations provided by the window are performed in the template directory by default, i.e. in the folder defined by the _TEMPLATE_DIR variable of the associated script. If this variable is not defined, your home folder is used. If you need to create or open a template image from a different location, type it with a full path.

To edit the template image either select the "Edit Template" button or double click the image preview component. A new window with a full screen image displays and you can use mouse drags to define which image area to crop. Note that though the image preview component will then display a cropped image, the Edit Template window will always display the full size image and you can edit the crop area as many times as needed. The image gets really cropped and saved to a file only when the Compareto Command Window is finished with the OK button.

To compare the selected image with the current desktop press the "Compare..." button. Comparison result in % will display in a popup window. Note that the result depends on the selected Comparison method. If you select the 'search' method, the comparison result popup will also display a list of coordinates where the template image was located and it will let you open a simple window with a copy of the remote desktop image with the highlighted search matches.

Button "Load RD Image..." allows you to load an image from a file and perform image comparisons through the "Compare..." button against it rather than against the remote desktop image. This feature is designed to help you to troubleshoot failed image comparisons which happened in the past, e.g. during automated test executions. It will have no effect on your script command. To switch the dialog back to the current remote desktop image click the same button again (it should read "Reset RD Image" when a custom image is loaded) or simply close and reopen the dialog.

The "Preferences" button serves as a shortcut to the image comparison preferences located in the Compareto command panel.

When the window is in the "Use an existing template image" mode, there are two more visible controls:

Compareto for an existing command

Other comparison parameters include:

Pass rate (in %) - Image comparison pass rate in %. Default value is 95%. It defines how much the images must match to pass the Compareto command.

Image comparison method - Method to be used to compare the selected image and remote desktop. VNCRobot 1.3 by default provides two image comparsion algorithms (methods) which are described in the Compareto command specification.  You can also write your own algorithm using the VNCRobot 1.3 Open API and plug it into VNCRobot.

Comparison area  - Allows to define a particular rectangle area to be used for image comparsion. If this parameter is omitted, the comparsion will be performed on the whole remote desktop image. If you click the "..." button, a simple window with the current remote desktop image opens where you can define the screenshot area using mouse drags.