为TestComplete编写tcx Extension(包含UserForm)
1. 按照正常逻辑编写并调试程序
2. 导出UserForm和js文件
1)UserForms: 对每一个UserForm都进行相同处理:右键-> Export to File -> 输入保存名称,保存
2)保存js文件
3. 将所需要的文件全部保存在指定文件夹中:
4. Description.xml 文件:必须存在的文件,TestComplete中对其解释如下:
-
description.xml - This is the “main” file of the package. It contains information about script extensions included in the package and custom actions, scripting objects and keyword test operations added by the extensions to TestComplete.
Each script extension package (.tcx file) must contain the description.xml file that describes the package contents. When you install a package, TestComplete parses the description.xml file, retrieves information about custom actions, scripting objects and keyword test operations to be added to TestComplete and adds information about the extension to the Script Extensions dialog.
<?xml version="1.0" encoding="UTF-8"?> <!-- encoding="UTF-8" --> <ScriptExtensionGroup Name = "UIPlugin"> <!--Name = "UIPlugin" Extension名称 --> <ScriptExtension Name = "Map/Update UI Properties to Database" Author = "XXXX" Version = "1.0" HomePage = "www.smartbear.com"> <!-- ScriptExtension Name 名称,命名--> <Script Name = "UIPluggin.js"> <RecordAction Name = "Map UI Properties" Icon = "JiraIcon.bmp" Routine = "RecordExecute"/> <DesignTimeAction Name = "Map UI Properties" Icon = "JiraIcon.bmp" Routine ="DesignTimeExecute"/> </Script> <Description> Map/Update UI Properties to database. </Description> </ScriptExtension> </ScriptExtensionGroup>