Enabled Property

Applies to TestComplete 14.70, 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

This property is available only if ArrayItemObj corresponds to the array item that belongs to the object. Enabled specifies whether the Run methods should process the item when they walk down the object hierarchy as it is described in the Controlling Object-Driven Tests topic. You can change the value of this property either from scripts or in the ODT editor by checking and unchecking the item icon (if Enabled is True, the item icon contains the element. Otherwise, this element is absent).

Declaration

ArrayItemObj.Enabled

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

Applies To

The property is applied to the following object:

Property Value

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

Example

The code below checks whether the elements of the MyVariable array are processed by the Run methods when they walk down the custom object hierarchy.

JavaScript, JScript

function ArrauItemEnabled()
{
   // Obtains information about the MyVariable object
   var ArrItems = ODT.Data.MyGroup.MyVariable;
   for (var i = 0; i < ArrItems.Count; i++)
     if ( ArrItems.Items(i).Enabled )
       Log.Message((i+1) + " item is processed by the Run methods.")
     else
       Log.Message((i+1) + " item is not processed by the Run methods.");
}

VBScript

Sub ArrauItemEnabled
   ' Obtains information about the MyVariable object
   Set ArrItems = ODT.Data.MyGroup.MyVariable
   For i = 0 to ArrItems.Count-1
     If ArrItems.Items(i).Enabled Then
       Log.Message(i+1 & " item is processed by the Run methods.")
     Else
       Log.Message(i+1 & " item is not processed by the Run methods.")
     End If
   Next
End Sub

DelphiScript

function ArrauItemEnabled;
var ArrItems, i;
begin
   // Obtains information about the MyVariable object
   ArrItems := ODT.Data.MyGroup.MyVariable;
   for i := 0 to ArrItems.Count-1 do
     if ( ArrItems.Items(i).Enabled ) then
       Log.Message((i+1) + ' item is processed by the Run methods.')
     else
       Log.Message((i+1) + ' item is not processed by the Run methods.');
end;

C++Script, C#Script

function ArrauItemEnabled()
{
   // Obtains information about the MyVariable object
   var ArrItems = ODT["Data"]["MyGroup"]["MyVariable"];
   for (var i = 0; i < ArrItems["Count"]; i++)
     if ( ArrItems["Items"](i)["Enabled"] )
       Log["Message"]( (i+1) + " item is processed by the Run methods." )
     else
       Log["Message"]( (i+1) + " item is not processed by the Run methods." );
}

See Also

Controlling Object-Driven Tests

Highlight search results