TestComplete Script Extension

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

該文件屬於包中的必備文件,主要包含了extension的各種重要信息。

我這裏舉一個簡單的例子:
<?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>

5. 將UIPlugin進行打包,然後重命名,生成UIPlugin.tcx文件。打開TestComplete安裝目錄,將UIPlugin.tcx放入:
\SmartBear\TestComplete 10\Bin\Extensions\ScriptExtensions  路徑下

6.  打開Testcomplete project, 打開“File-Install Script Extensions>”,選擇,OK


出現該擴展插件圖標,可以使用。



7.注意事項:
打包層次,不要不小心多加一層。我開始沒注意,導致不能正常load


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章