Count Property

Applies to TestComplete 15.64, last modified on May 16, 2024

Description

Use the aqObjIteratorObj.Count property to get the total number of items in the collection.

Declaration

aqObjIteratorObj.Count

Read-Only Property Integer
aqObjIteratorObj An expression, variable or parameter that specifies a reference to an aqObjIterator object

Applies To

The property is applied to the following object:

Property Value

The total number of items in the collection.

Example

The code below obtains the collection of the drives existing on your computer and posts their total number to the test log.

JavaScript, JScript

function ObtainDrivesNumber()
{

  // Obtains the drives collection
  var DrvCol = aqFileSystem.Drives;
  
  // Obtains the drives total number
  var Num = DrvCol.Count;
  
  // Posts the drives number to the test log
  Log.Message("There are " + Num + " drives existing on your computer.");
    
}

Python

def ObtainDrivesNumber():
  # Obtains the drives collection
  DrvCol = aqFileSystem.Drives
  # Obtains the drives total number
  Num = DrvCol.Count
  # Posts the drives number to the test log
  Log.Message("There are " + str(Num) + " drives existing on your computer.")

VBScript

Sub ObtainDrivesNumber

  ' Obtains the drives collection
  Set DrvCol = aqFileSystem.Drives
  
  ' Obtains the drives total number
  Num = DrvCol.Count
  
  ' Posts the drives number to the test log
  Log.Message "There are " & Num & " drives existing on your computer."
    
End Sub

DelphiScript

function ObtainDrivesNumber;
var DrvCol, Num;
begin

  // Obtains the drives collection
  DrvCol := aqFileSystem.Drives;
  
  // Obtains the drives total number
  Num := DrvCol.Count;
  
  // Posts the drives number to the test log
  Log.Message('There are ' + Num + ' drives existing on your computer.');
    
end;

C++Script, C#Script

function ObtainDrivesNumber()
{

  // Obtains the drives collection
  var DrvCol = aqFileSystem["Drives"];
  
  // Obtains the drives total number
  var Num = DrvCol["Count"];
  
  // Posts the drives number to the test log
  Log["Message"]("There are " + Num + " drives existing on your computer.");
    
}

See Also

Item Method
Skip Method

Highlight search results