爲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>