Enabled Property

Applies to TestComplete 14.40, last modified on April 22, 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 Enabled property specifies whether or not the object’s property is analyzed by the Run methods that walk down the object hierarchy. For more information about this, see the Controlling Object-Driven Tests topic.

Declaration

PropertyObj.Enabled

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

Applies To

The property is applied to the following object:

Property Value

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

Example

The following example demonstrates how to get access to an object’s property and how to specify that the property will not be analyzed by the Run methods.

JavaScript, JScript

function PropertySample()
{

  var PropertyObj, Variable, Obj;
  // Obtains the Property object
  Obj = ODT.Data.Groups("Data").Variables("SampleVar").Value;
  PropertyObj = Obj.Properties("PropertyName");
  // Specifies that the property will not be analyzed
  PropertyObj.Enabled = false;
  …

}

VBScript

Sub PropertySample

  Dim PropertyObj, Variable, Obj
  ' Obtains the Property object
  Set Obj = ODT.Data.Groups("Data").Variables("SampleVar").Value
  Set PropertyObj = Obj.Properties("PropertyName")
  ' Specifies that the property will not be analyzed
  PropertyObj.Enabled = False
  …

End Sub

DelphiScript

procedure PropertySample();
var PropertyObj, Variable, Obj;
begin

  // Obtains the Property object
  Obj := ODT.Data.Groups['Data'].Variables['SampleVar'].Value;
  PropertyObj := Obj.Properties['PropertyName'];
  // Specifies that the property will not be analyzed
  PropertyObj.Enabled := false;
  …

end;

C++Script, C#Script

function PropertySample()
{

  var PropertyObj, Variable, Obj;
  // Obtains the Property object
  Obj = ODT["Data"]["Groups"]("Data")["Variables"]("SampleVar")["Value"];
  PropertyObj = Obj["Properties"]("PropertyName");
  // Specifies that the property will not be analyzed
  PropertyObj["Enabled"] = false;
  …

}

See Also

Controlling Object-Driven Tests
IsFiltered Property

Highlight search results