11. Deploying the Extension

Applies to TestComplete 15.44, last modified on November 10, 2022

When the description file and script code are ready and tested, we can pack them into one extension file and deploy the file to users.

Script extension files are .zip files that have the .tcx extension. So, you should pack the files to the zip archive and change the archives extension from .zip to .tcx.

In our case, the extension’s file name should be ActionsExtension.tcx. We will use this name, since we named the help file ActionsExtension.chm and this name must coincide with the extension’s file name. If you want, you can use any other name, but, you have to rename the help file and change the ctcForm_cbHelp_OnClick routine in the clcCode.js unit. Note that the name of a .chm help file must not contain spaces.

Before packing the files, make sure that all of the needed files reside in the same folder. In our case, all of the following files must be located in the C:\My Extension Files\ActionsExtension folder:

  • description.xml
  • clcCode.js
  • clc-icon.bmp
  • ctcForm.aqfrm
  • ActionsExtension.chm

You can pack the files with any tool that supports the zip format. You can even use TestComplete since it supports the zip packer functionality included in the operating system. To pack the files, you can use the following script code:

JavaScript, JScript

function PackFiles()
{
  var FileNames, FolderName;

  FolderName = "C:\\My Extension Files\\ActionsExtension";
  FileNames = slPacker.GetFileListFromFolder(FolderName);

  slPacker.Pack(FileNames, FolderName, FolderName + "\\ActionsExtension.tcx");
}

Python

def PackFiles():
  FolderName = "C:\\My Extension Files\\ActionsExtension"
  FileNames = slPacker.GetFileListFromFolder(FolderName)

  slPacker.Pack(FileNames, FolderName, FolderName + "\\ActionsExtension.tcx")

VBScript

Sub PackFiles
  Dim FileNames, FolderName

  FolderName = "C:\My Extension Files\ActionsExtension"
  FileNames = slPacker.GetFileListFromFolder(FolderName)

  Call slPacker.Pack(FileNames, FolderName, FolderName + "\ActionsExtension.tcx")
End Sub

DelphiScript

procedure PackFiles;
var
  FileNames, FolderName : OleVariant;
begin
  FolderName := 'C:\My Extension Files\ActionsExtension';
  FileNames := slPacker.GetFileListFromFolder(FolderName);
  slPacker.Pack(FileNames, FolderName, FolderName + '\ActionsExtension.tcx');
end;

C++Script, C#Script

function PackFiles()
{
  var FileNames, FolderName;

  FolderName = "C:\\My Extension Files\\ActionsExtension";
  FileNames = slPacker["GetFileListFromFolder"](FolderName);

  slPacker["Pack"](FileNames, FolderName, FolderName + "\\ActionsExtension.tcx");
}

After creating the .tcx file, you can install the extension into TestComplete and test how it works. For more information about this, see Installing and Uninstalling Script Extensions.

Two notes:

  • The code created in this tutorial is part of the AQAScriptExtensions.tcx file that is included in TestComplete. You can find this file in the <TestComplete>\Bin\Extensions\ScriptExtensions folder.

  • The script extensions that are included into the AQAScriptExtensions.tcx file are installed in TestComplete by default. So, TestComplete already contains the clipboard checkpoint.

    In order for the tutorial script extension to function properly, disable the pre-installed extension in the Script Extensions dialog before installing your extension in TestComplete.

Prev

See Also

Script Extensions
Deploying Script Extensions
Installing and Uninstalling Script Extensions

Highlight search results