Enabled Property

Applies to TestComplete 14.92, last modified on September 16, 2021

The object-driven testing (ODT) functionality is deprecated. Do not use it to create new tests. It will be removed from the product in one of the future releases. As an alternative, you can create custom classes in your scripts. For more information, see Alternatives to the ODT functionality.

Description

The Variable.Enabled property specifies whether or not the variable is analyzed by the Run methods that walk down the object hierarchy. For more information about this, see Controlling Object-Driven Tests.

Declaration

VariableObj.Enabled

Read-Write Property Boolean
VariableObj An expression, variable or parameter that specifies a reference to a Variable object

Applies To

The property is applied to the following object:

Property Value

If Enabled is True, the Run methods will process the variable when they walk down the object hierarchy. Otherwise, they will not process it.

Example

The following code snippet enables the specified variable and then runs the testing:

JavaScript, JScript

function Test()
{

  var Group, MyVar;

  // Obtains the data group
  Group = ODT.Data.Groups("MyGroup");
  // Obtains the variable
  MyVar = Group.Variables("MyVar");
  // The variable will be analyzed by the Run method
  MyVar.Enabled = true;
  // Analyzes the group structure
  Group.Run();

}

VBScript

Sub Test

  Dim Group, MyVar

  ' Obtains the data group
  Set Group = ODT.Data.Groups("MyGroup")
  ' Obtains the variable
  Set MyVar = Group.Variables("MyVar")
  ' The variable will be analyzed by the Run method
  MyVar.Enabled = True
  ' Analyzes the group structure
  Group.Run

End Sub

DelphiScript

procedure Test();
var Group, MyVar;

begin

  // Obtains the data group
  Group := ODT.Data.Groups('MyGroup');
  // Obtains the variable
  MyVar := Group.Variables('MyVar');
  // The variable will be analyzed by the Run method
  MyVar.Enabled := true;
  // Analyzes the group structure
  Group.Run;

end;

C++Script, C#Script

function Test()
{

  var Group, MyVar;

  // Obtains the data group
  Group = ODT["Data"]["Groups"]("MyGroup");
  // Obtains the variable
  MyVar = Group["Variables"]("MyVar");
  // The variable will be analyzed by the Run method
  MyVar["Enabled"] = true;
  // Analyzes the group structure
  Group["Run"]();

}

See Also

Controlling Object-Driven Tests
Run Method
Run Method

Highlight search results