Scripts written in the proprietary language may be easily converted to Java using the Java converter in the T-Plan Robot Enterprise GUI. Note: This conversion is one way only, and Java test scripts can not be converted back to the proprietary scripting language.
The converter is designed to help with migration of existing scripts to Java. It is a logical step in the automation process, as people usually start with the scripting language, and when the automation becomes more mature, they then convert to Java. As we are maintaining a strict language compatibility with the previous product versions, the conversion process may be applied to any script designed with previous projects. The converter should produce a functional (though not neat) Java code, even where the T-Plan Robot Enterprise scripting engine was enhanced with custom commands through the standard plug in interface.
Conversion also plays an important role in enabling the Record & Replay feature with Java scripts. Though direct recording to Java is not supported, you may record your desktop interaction to a standard script first and then take advantage of the converter to generate the corresponding Java code.
Be aware that the converter is not perfect and it may fail to convert certain custom expressions, especially where abundant variables are applied, and manual correction of the resulting Java code may be required. You should always review the Java code to make sure that it corresponds to the original script and run it against a test environment to verify its behaviour.
For example, to convert the calculator script follow these steps:
- Copy & paste the script code from the
calculator.tprexample below into the T-Plan Robot Enterprise script editor.
- Select File->Export to Java in the menu or press Ctrl+J in the editor.
- Fill in "Calculator" for class name in the Java Preferences window and hit OK.
- A new editor with the Java code similar to what you see below must open. You may eventually execute it to make sure it behaves the same way as the original one.