Structure of the Description File

Applies to TestComplete 14.30, last modified on November 21, 2019

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

<ScriptExtensionGroup Name="">
    <Category Name="">
        <ScriptExtension Name="" Author="" Version="" HomePage="">
            <Script Name="" InitRoutine="" FinalRoutine="">

                <Option Name="" DefaultValue="" />

                <RecordAction Name="" Icon="" Routine="" />

                <DesignTimeAction Name="" Icon="" Routine="" />

                <LogAction Name="" Icon="" Routine="" />

                <RuntimeObject Name="" Namespace="">
                    <Method Name="" Routine="">Method description</Method>
                    <Property Name="" GetRoutine="" SetRoutine="">Property description</Property>
                    <Description>Runtime object description</Description>
                </RuntimeObject>

                <KDTOperation Name="" Category="" Icon="" OperationType="">
                    <Parameters>
                        <Parameter Name="" DefaultValue="">Parameter description</Parameter>
                    </Parameters>
                    <Data>
                        <Field Name="" DefaultValue="" Persistent="">Field description</Field>
                    </Data>
                    <Events>
                        <Event Name="" Routine="" />
                    </Events>
                    <Columns>
                        <Column Name="" Value="" GetValue="" Hint="" GetHint="" Editable="" EditorType="">
                            <Event Name="" Routine="" />
                        </Column>
                    </Columns>
                </KDTOperation>

            </Script>
            <Description>Script extension description</Description>
        </ScriptExtension>
    </Category>
</ScriptExtensionGroup>

The description.xml has the following structure:

The root element of the description file is ScriptExtensionGroup. It serves as a package for the script extensions and contains one or more Category elements that define categories of script extensions included into the package. The Name attribute of this element is displayed in the TestComplete Script Extensions dialog as the category name and is used to group extensions by categories.

The Category element contains child ScriptExtension elements corresponding to extensions that are provided by the package and belong to the appropriate category. The ScriptExtension element is used for all types of extensions -- those that add custom actions, custom objects as well as custom keyword test operations. The contents of the Name, Author and Version attributes of the ScriptExtension element are displayed in the Script Extensions dialog and are used to uniquely identify the extension. The contents of the child Description element are shown as the extension’s description in the dialog.

The ScriptExtension element contains child Script elements for script files included into the extension. That is, it has one Script element per script file that contains the implementation of a custom action, object and/or keyword test operation. The Name attribute of the Script element specifies the script file’s name. The file must be in the same package as the description file, so you should only specify the file name and extension (without the path).

The scripting language is determined by the file extension: .vbs for VBScript and .js for JScript. The script extensions package may contain files written in different scripting languages (that is, you may use both VBScript and JScript files in one package). Moreover, one ScriptExtension may contain Script elements that correspond to scripting files written in different languages.

The Script element contains any number of the following child elements that correspond to custom actions, objects and keyword test operations implemented in the script file:

  • RecordAction - This element is used to create custom actions that will work during the test recording. The extension installer adds these actions to the Recording toolbar of TestComplete.

  • DesignTimeAction - This element is used to create custom actions that will work at design time, that is, when TestComplete is neither recording, nor running tests. The extensions installer will add the action to the Tools toolbar of TestComplete.

  • LogAction - This element is used to create custom actions that will export the test log to a .mht file and process the exported log in a custom way. The extensions installer will add the action to the toolbar of the TestComplete Test Log panel.

  • RuntimeObject - This element is used to create custom scripting objects. The object is added to the TestComplete object model and is shown in the Code Completion window.

    The RuntimeObject element may contain the following elements:

    • Any number of Method elements. Each element defines the object’s method. The element attributes specifies the script routine that is executed when a user calls the object’s methods from a script. The element’s contents contain the descriptive text for the method. This text is shown in the Code Completion window as the method description.

    • Any number of Property elements. Each element defines the object’s property. The element attributes specifies the script routines that are used to retrieve or set the property value. The element’s contents contain the descriptive text for the property. This text is shown in the Code Completion window as the property description.

    • One Description element. It contains a descriptive text for the object. This text is shown in the Code Completion window as the object’s description.

  • KDTOperation - This element is used to define custom keyword test operations. The operation is added to the Operations panel of the Keyword Test editor.

    The KDTOperation element may contain the following elements in any order:

    • One Parameters element. It contains one or more child Parameter elements that define the operation’s parameters. Each Parameter element has attributes that define the parameter name and, optionally, default value. The element may also contain the parameter description; however, it is not used by TestComplete anyhow.

    • One Data element. It contains one or more child Field elements that define the operation’s internal fields. Each Field element has attributes that specify the field name and, optionally, default value and persistence flag. The element’s contents may specify the field description; it is currently ignored by TestComplete, though.

    • One Events element containing one or more child Event elements. An Event element subscribes to an operation’s certain event and specifies the script routine used as the event handler. These routines will be executed by the operation in different situations. For example, the OnExecute event handler is the routine that is executed by the operation during the test run.

    • One Columns element with one or more child Column elements. The latter define data to be displayed in various columns of the Keyword Test editor. The Column element’s attributes specify the name of the corresponding column of the Keyword Test editor, the text to be displayed in the editor or the script routine that returns this text, the column’s hint text or the routine that returns it.

      A Column element may also have attributes that enable the edit mode in the column and specify the type of in-place editor. In this case, the Column element may contain one or more child Event elements specifying script routines that handle various events of the in-place editor.

  • Option - This element is used to specify script extension options. Use the element to define settings, conditions, and data that affect the script extension’s functionality. To access the options from the script extension code, use the Options object.

For detailed information about elements and their attributes, see the Elements Reference.

See Also

Script Extensions
Script Extension Files
Elements Reference

Highlight search results