Script Element

Applies to TestComplete 15.63, last modified on April 10, 2024
Description

The Script elements are used in the description.xml file. They correspond to the source files included in the script extension. Every script file typically contains the implementation of one or more custom actions, objects and keyword test operations.

Parent Elements

A Script element must be a child of a ScriptExtension element.

Child Elements

A Script element contains one or more of the following child elements in any combination:

RecordAction, DesignTimeAction, LogAction, RuntimeObject, KDTOperation

Attributes

The element has the following attributes:

Name

Required. Specifies the script file name. The script file must reside in the same package, in which the description.xml file is located, so you should only specify the file name and extension (without the path).

InitRoutine

Optional. Specifies the name of the routine that performs the initialization actions. The routine is called if the initialization has not been performed yet and any of the following events happen:

  • A user executes an action defined by a child DesignTimeAction, RecordAction, or LogAction element.

  • The Code Completion window shows methods and properties of the object defined by a child RuntimeObject element.

    -- or --

    The object’s method or property is called.

  • The user adds an operation defined by a child KDTOperation element to a keyword test.

  • The user opens the project containing the keyword test that includes an operation defined by a child KDTOperation element.

FinalRoutine

Optional. Specifies the name of the routine that performs the finalization actions. The routine is called when one of the following events happen:

Note that the finalization is only performed for those script units that was executed by the initialization. If the unit was not initialized, it is not finalized.

If the finalization is performed after the user clicked the Reload button in the Script Extensions dialog, TestComplete considers the unit as the unit that were not initialized.

Remarks

The scripting language is determined by the extension of the script file:

  • .js - JScript file

  • .vbs - VBScript file

See Also

Elements Reference
Structure of the Description File
Creating Script Extensions
Objects Available to Script Extensions
Creating Initialization and Finalization Routines

Highlight search results