Checked Property

Applies to TestComplete 15.69, last modified on November 13, 2024

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 PropValueSet.Checked specifies if objects, whose properties hold the specified value, are processed by the Run methods when the latter walks down the custom objects hierarchy (see Controlling Object-Driven Tests for complete information on this).

Value is specified by index in the collection. The total number of values in the collection is specified by the Count property.

Declaration

PropValueSetObj.Checked(Index)

Read-Write Property Boolean
PropValueSetObj An expression, variable or parameter that specifies a reference to a PropValueSet object
Index [in]    Required    Integer    

Applies To

The property is applied to the following object:

Parameters

The property has the following parameter:

Index

Specifies the index of the desired value in the collection. The first index in the collection is 0, the second - 1, etc.

Property Value

If Checked is True, the Run methods will process the object whose properties have the specified values. Otherwise they will not.

Example

The following example iterates through the elements of the PropValueSet collection, posts values stored in the collection to the test log informing whether the values will be processed by the Run method.

JavaScript, JScript

function PropValueSetSample()
{
  // Obtains the specified class
  var MyClassObj = ODT.Classes.MyClass;
  // Obtains the PropValueSet collection
  var PropValueSetObj = MyClassObj.PropValueSet("MyProperty");
  // Determines the total number of items in the collection
  var Count = PropValueSetObj.Count;

  // Iterates through the collection
  for (var i = 0; i < Count; i++)
  {
    // Posts a value to the test log and informs whether the value will be processed
    var Value = PropValueSetObj.Values(i);
    if (PropValueSetObj.Checked(i))
      Log.Message(Value + ": Enabled")
    else
      Log.Message(Value + ": Disabled");
  }
}

VBScript

Sub PropValueSetSample

  ' Obtains the specified class
  Set MyClassObj = ODT.Classes.MyClass
  ' Obtains the PropValueSet collection
  Set PropValueSetObj = MyClassObj.PropValueSet("MyProperty")
  ' Determines the total number of items in the collection
  Count = PropValueSetObj.Count

  ' Iterates through the collection
  For i = 0 To Count - 1
    ' Posts a value to the test log and informs whether the value will be processed
    Value = PropValueSetObj.Values(i)
    If PropValueSetObj.Checked(i) Then
      Log.Message(Value & ": Enabled")
    Else
      Log.Message(Value & ": Disabled")
    End If
  Next
End Sub

DelphiScript

procedure PropValueSetSample();
var MyClassObj, PropValueSetObj, Count, Value, i;
begin
  // Obtains the specified class
  MyClassObj := ODT.Classes.MyClass;
  // Obtains the PropValueSet collection
  PropValueSetObj := MyClassObj.PropValueSet['MyProperty'];
  // Determines the total number of items in the collection
  Count := PropValueSetObj.Count;

  // Iterates through the collection
  for i := 0 to Count - 1 do
  begin
    // Posts a value to the test log and informs whether the value will be processed
    Value := PropValueSetObj.Values[i];
    if PropValueSetObj.Checked[i] then
      Log.Message(Value + ': Enabled')
    else
      Log.Message(Value + ': Disabled');
  end;
end;

C++Script, C#Script

function PropValueSetSample()
{
  // Obtains the specified class
  var MyClassObj = ODT["Classes"]["MyClass"];
  // Obtains the PropValueSet collection
  var PropValueSetObj = MyClassObj["PropValueSet"]("MyProperty");
  // Determines the total number of items in the collection
  var Count = PropValueSetObj["Count"];

  // Iterates through the collection
  for (var i = 0; i < Count; i++)
  {
    // Posts a value to the test log and informs whether the value will be processed
    var Value = PropValueSetObj["Values"](i);
    if (PropValueSetObj["Checked"](i))
      Log["Message"](Value + ": Enabled")
    else
      Log["Message"](Value + ": Disabled");
  }
}

See Also

Controlling Object-Driven Tests
ValueIndex Property
Values Property
Count Property

Highlight search results