aqObjProperty Object

Applies to TestComplete 15.68, last modified on October 03, 2024

Description

The aqObjProperty object provides a scripting interface to object properties that you can see on the Properties page of the Object Browser panel. To obtain the aqObjProperty object in scripts, use the GetProperties method of the aqObject object.

Note: Actually, the GetProperties method returns the aqObjIterator object that stores information about all found object properties. To get information about a single property, you can use the aqObjIterator.Item and aqObjIterator.Next methods.

Members

Example

The code below obtains the collection of properties that belong to the specified object and then posts these properties' names to the test log.

JavaScript, JScript

function GetPropertiesExample()
{

  // Specifies the object
  var Obj = Sys.Process("MyApllication");
  
  // Obtains the properties collection
  var PropCol = aqObject.GetProperties(Obj);
  
  // Posts the names of the properties to the test log
  while ( PropCol.HasNext() )
  {
    var PropItem = PropCol.Next();
    Log.Message(PropItem.Name);
  }

}

Python

def GetPropertiesExample():
  # Specifies the object 
  Obj = Sys.Process("MyApplication")
  # Obtains the properties collection
  PropCol = aqObject.GetProperties(Obj)
  # Posts the names of the properties to the test log
  while PropCol.HasNext():
    PropItem = PropCol.Next()
    Log.Message(PropItem.Name)

VBScript

Sub GetPropertiesExample

  ' Specifies the object
  Set Obj = Sys.Process("MyApllication")
  
  ' Obtains the properties collection
  Set PropCol = aqObject.GetProperties(Obj)
  
  ' Posts the names of the properties to the test log
  While PropCol.HasNext
    Set PropItem = PropCol.Next
    Log.Message PropItem.Name
  WEnd

End Sub

DelphiScript

function GetPropertiesExample;
var Obj, PropCol, PropItem;
begin

  // Specifies the object
  Obj := Sys.Process('MyApllication');
  
  // Obtains the properties collection
  PropCol := aqObject.GetProperties(Obj);
  
  // Posts the names of the properties to the test log
  while ( PropCol.HasNext() ) do
  begin
    PropItem := PropCol.Next();
    Log.Message(PropItem.Name);
  end;

end;

C++Script, C#Script

function GetPropertiesExample()
{

  // Specifies the object
  var Obj = Sys["Process"]("MyApllication");
  
  // Obtains the properties collection
  var PropCol = aqObject["GetProperties"](Obj);
  
  // Posts the names of the properties to the test log
  while ( PropCol["HasNext"]() )
  {
    var PropItem = PropCol["Next"]();
    Log["Message"]( PropItem["Name"] );
  }

}

See Also

aqObjIterator Object

Highlight search results