Option Element

Applies to TestComplete 15.20, last modified on January 19, 2022
Description

Option elements are used in the description.xml files to specify script extension options.

Parent Elements

An Option element must be a child of the Script element.

Child Elements

An Option element does not have child elements.

Attributes

The element has the following attributes:

Name

Required. Specifies the option’s name.

  • The option name must be unique among other option names specified for the current Script element.
  • The name is used to address options from scripts, so it must be a valid identifier in the scripting language that is used to write the source script code (JScript or VBScript): it must consist only of alphanumeric (A…Z, a…z, 0…9) and underscore ( _ ) characters and must start with a letter.

DefaultValue

Optional. Specifies a script extension option’s default value. If the DefaultValue attribute is not specified for the option in the description file, the option value remains empty until a new value is assigned. The new value is saved automatically between TestComplete sessions to make it available when a new TestComplete session starts.

Note: Script extension options are account-dependable. Changes made to options under one account are not available under another account.

To access options from the script extension code, use the Options program object:

JScript

Options.TestOption = "New Value";

VBScript

Options.TestOption = "New Value"

Note that the option value must be enclosed in quotes.

See Also

Elements Reference
Structure of the Description File
Options Object (Script Extensions)
Storing Script Extension Options Between TestComplete Sessions
Creating Custom Actions
Creating Actions Tutorial

Highlight search results