Image Doctor


1. Overview
2. Image Doctor Warning
3. Image Doctor Records

1. Overview

The Image Doctor wizard was delivered in v3.5. It allows to resolve image comparison failures in executed scripts, especially in cases where the system has changed and the image comparison code and/or the template images must be updated. The wizard consists of three elements:

  1. The Image Doctor Warning pop up window allows to resolve image comparison interactively.
  2. The Image Doctor Records facility records failed image comparisons in the automation (unattended) mode for later resolution. 
  3. The ImageDoctor command (for TPR scripts) and the corresponding imageDoctorXXX() methods (Java scripts) control the Image Doctor behaviour from a script.

Behavior of the Image Doctor is subject to the Robot's start up mode and options selected in the Edit -> Preferences -> Image Doctor configuration screen:

  • Image Doctor gets activated on start up when the "Start Image Doctor on Robot start up" option is on. The factory setting is "on".
    • When Robot runs in the GUI mode (without the -n CLI option) you can set it on or off at any time the Script -> Enable Image Doctor menu item.
    • Scripts may set it on or off through a call of the ImageDoctor command or the imageDoctorXXX() Java methods.
  • If Robot was started in the development mode (without the r/-run CLI option) and a command or a Java method call employing image comparison fails in the currently executed script, the Image Doctor Warning window pops up.
  • If Robot was started in the automation mode (with the r/-run CLI option) and a command or a Java method call employing image comparison fails in the currently executed script, the wizard records the failure through the Image Doctor Records facility.
    • To make the wizard pop up the Image Doctor Warning window in the GUI automation mode select the corresponding option in Preferences or set on the Script -> Enable Image Doctor Warning menu item. The item is visible only in the GUI automation mode.

2. Image Doctor Warning

The Image Doctor Warning window allows to resolve comparison failures immediately without having to stop the currently executing script.

  1. The "Resolve Now" button opens up the command editor (the command "Properties" window). Update the comparison parameters and/or the template images as needed (limitations apply) and save the changes with OK. You may optionally apply other changes directly in the script editor and/or the Project View while the script is paused. Then resume the script by clicking the Resume button and the comparison command will re-execute. This will allow the script to continue as if the failure had never happened.
  2. The "Record & Resume" button will store the data of the failure to the hard drive and resume the script. The record may be then viewed in and eventually resolved through the Image Doctor Records window.
  3. The "Ignore & Resume" button will resume the script without any further action.


TPR Scripts:
You may modify the command parameters and/or recreate, add or remove the template images. You may also modify the code after the command. No changes in the preceding code (the already executed one) will be picked up unless they are in an already existing procedure.

Java Scripts:
You will be allowed then to modify the method call parameters and/or recreate, add or remove the image templates under the following rules:

  • Images can be modified only if they are referred to by the name and/or path directly (no parametrized or composed file/path names).
  • The script must execute from the source code (.java). Scripts started through the main() method from a compiled .class file do not support the Resolve Now operation.
  • Any changes that do not modify the Java source code will work without any limitations. This applies for example to recreation (rewriting) of images, adding of new images to already referred collections or modifying the command preferences.
  • Any other parameter changes will apply just to the particular comparison. If this method call gets called again within the same execution you will have to reapply them because the compiled Java code can't be reloaded until the script finishes. The next time you start the script the changes will be applied permanently.

3. Image Doctor Records

The Image Doctor Records facility captures data about failed image comparisons for later use. This approach is used mainly when the script is executed through the r/-run CLI option in a production environment. It works as follows:

  1. An image comparison fails in a script started through the r/-run CLI option.
  2. The facility detects the failure and records a PNG screen shot and a .properties text file with the details (failure cause and location, date, environment). The data is stored to the imgdoctor/ folder under the home of the project the script belongs to. If there's no project the data goes to <userHome>/imgdoctor.
  3. The facility saves an entry of the new record to the user configuration file. This mechanism ensures that the new incidents are reported later after Robot gets started in the development mode.
  4. The script resumes as expected.

The records may be also created manually through the Record & Resume button of the Image Doctor Warning window. The next time the user starts T-Plan Robot Enterprise in the development mode (without r/run), the GUI reports that there are new records and suggests to resolve them through the Image Doctor Records window. The window is also available through the Script>Image Doctor Records menu item.

  1. The New Records tree branch displays new incidents which haven't been reported yet. This list is loaded from the configuration file and it may comprise of records created across multiple projects. The Current Project Records tree branch lists all records available in the current project.
  2. The tabbed pane at the bottom displays details of the currently selected record.
  3. The Resolve button allows to resolve the failure in three steps:
    a)  The script is opened in the script editor and it changes the position to the failure location. The GUI also reopens the script project if it is different from the current one.
    b)  The PNG screen shot is loaded either to the desktop view through the Static Image connection or to the command Properties dialog only. The latter option will preserve the current desktop connection.
    c)   The command Properties window gets displayed to allow adjusting of the command against the recorded screenshot image.
  4. The Show Location button will show location of the selected record in the script editor. This action will not reload the script project if it differs from the current one.
  5. The Open Project button will reopen the project the selected record belongs to. The tree of records will be updated accordingly.
  6. The Delete button will delete the selected record(s).
  7. The Configure button leads to the Image Doctor screen of the Preferences window. It controls the facility behaviour.