Options Object (Script Extensions)

Applies to TestComplete 14.50, last modified on April 22, 2021

The Options object provides access to script extension options and allows you to retrieve and set their values from the extension’s code.

The options are defined by the Option elements in the script extension’s description.xml file. To access a specific option in script extension code, use the Options.OptionName syntax, where OptionName is the option name specified by the Name attribute of the corresponding Option element. The following code demonstrates how you get and set the value of an option named UserName:

JScript

// Copy the option value to a text box on a form
UserForms.frmLogin.txtUserName.Text = Options.UserName;

// ...

// Store the text box value in the option
Options.UserName = UserForms.frmLogin.txtUserName.Text;

VBScript

' Copy the option value to a text box on a form
UserForms.frmLogin.txtUserName.Text = Options.UserName

' ...

' Store the text box value in the option
Options.UserName = UserForms.frmLogin.txtUserName.Text

To learn more about using options in script extensions, see Storing Script Extension Options Between TestComplete Sessions.

See Also

Storing Script Extension Options Between TestComplete Sessions
Objects Available to Script Extensions
Option Element

Highlight search results