Deploying Script Extensions

Applies to TestComplete 15.68, last modified on October 16, 2024

Script extensions are packaged as .tcx files. This package is a ZIP archive that contains all of the script extension files -- scripts, forms, the description file, icons and the help file (see Script Extension Files). Note, that the archive must only contain the mentioned files and you cannot organize files into subfolders.

Correct:

Incorrect:

To create ZIP archives, you can use Windows built-in archiving functionality or a third-party archiver like WinZip. After zipping the extension’s files, change the archive extension to tcx.

Note, that you can also pack the script extension files into a .tcx file using the TestComplete slPacker object. The following sample routine demonstrates how this can be done:

JavaScript, JScript

function PackExtension()
{
  // The folder that contains the extension's source files:
  var SrcFolder = "C:\\MyExtensionFiles\\";
  // The list of the extension's source files:
  var SrcFiles = new Array ("script.js", "MyForm.aqfrm", "description.xml", "MyExtension.chm");
  // The fully-qualified name of the resulting .tcx file:
  var ExtensionFileName = SrcFolder + "MyExtension.tcx";

  slPacker.Pack(SrcFiles.join("\r\n"), SrcFolder, ExtensionFileName);
}

Python

def PackExtension():
  # The folder that contains the extension's source files:
  SrcFolder = "C:\\MyExtensionFiles\\"
  # The list of the extension's source files:
  SrcFiles =  "script.js" + "\r\n" + \
              "MyForm.aqfrm" + "\r\n" + \
              "description.xml" + "\r\n" + \
              "MyExtension.chm"
  # The fully-qualified name of the resulting .tcx file:
  ExtensionFileName = SrcFolder + "MyExtension.tcx"

  slPacker.Pack(SrcFiles, SrcFolder, ExtensionFileName)

VBScript

Sub PackExtension
  Dim SrcFolder, SrcFiles, ExtensionFileName

  ' The folder that contains the extension's source files:
  SrcFolder = "C:\MyExtensionFiles\"
  ' The list of the extension's source files:
  SrcFiles = Array ("script.js", "MyForm.aqfrm", "description.xml", "MyExtension.chm")
  ' The fully-qualified name of the resulting .tcx file:
  ExtensionFileName = SrcFolder & "MyExtension.tcx"

  Call slPacker.Pack(Join(SrcFiles, vbNewLine), SrcFolder, ExtensionFileName)
End Sub

DelphiScript

procedure PackExtension;
var SrcFolder, SrcFiles, ExtensionFileName;
begin
  // The folder that contains the extension's source files:
  SrcFolder := 'C:\MyExtensionFiles\';
  // The names of the extension's source files, separated by new line characters:
  SrcFiles := 'script.js'       + #13#10 +
              'MyForm.aqfrm'    + #13#10 +
              'description.xml' + #13#10 +
              'MyExtension.chm';
  // The fully-qualified name of the resulting .tcx file:
  ExtensionFileName := SrcFolder + 'MyExtension.tcx';

  slPacker.Pack(SrcFiles, SrcFolder, ExtensionFileName);
end;

C++Script, C#Script

function PackExtension()
{
  // The folder that contains the extension's source files:
  var SrcFolder = "C:\\MyExtensionFiles\\";
  // The list of the extension's source files:
  var SrcFiles = new Array ("script.js", "MyForm.aqfrm", "description.xml", "MyExtension.chm");
  // The fully-qualified name of the resulting .tcx file:
  var ExtensionFileName = SrcFolder + "MyExtension.tcx";

  slPacker["Pack"](SrcFiles["join"]("\r\n"), SrcFolder, ExtensionFileName);
}

Note: To be able to package script extensions with the slPacker objects, the Script configuration option must specify the archiver configuration that uses the ZIP format.

The created package is now ready for installation into TestComplete (to learn how to do it, see Installing and Uninstalling Script Extensions). You can also share the extension with your team members or other TestComplete users.

See Also

Script Extensions
Script Extension Files
Publishing Script Extensions to Web
Installing and Uninstalling Script Extensions
Creating Script Extensions

Highlight search results