aqObjField Object

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

Description

The aqObjField object provides a scripting interface to object fields that you can see on the Fields page of the Object Browser panel. To obtain the aqObjField object in scripts, use the GetFields method of the aqObject object.

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

Members

Example

The code below obtains the fields collection that belongs to the specified object and posts the event names to the test log.

JavaScript, JScript

function FieldName()
{

  // Specifies the object
  var Obj = Sys.Process("MyApplication");
  
  // Obtains the fields collection
  var FieldCol = aqObject.GetFields(Obj);
  
  while ( FieldCol.HasNext() )
    Log.Message(FieldCol.Next().Name);
  
}

Python

def FieldName():
  # Specifies the object
  Obj = Sys.Process("MyApplication")
  # Obtains the fields collection
  FieldCol = aqObject.GetFields(Obj)
  while FieldCol.HasNext():
    Log.Message(FieldCol.Next().Name)

VBScript

Sub FieldName
  
  ' Specifies the object
  Set Obj = Sys.Process("MyApplication")
  
  ' Obtains the fields collection
  Set FieldCol = aqObject.GetFields(Obj)
  
  While FieldCol.HasNext
    Log.Message FieldCol.Next.Name
  WEnd
  
End Sub

DelphiScript

function FieldName;
var Obj, FieldCol;
begin

  // Specifies the object
  Obj := Sys.Process('MyApplication');
  
  // Obtains the fields collection
  FieldCol := aqObject.GetFields(Obj);
  
  while ( FieldCol.HasNext() ) do
    Log.Message(FieldCol.Next().Name);
  
end;

C++Script, C#Script

function FieldName()
{

  // Specifies the object
  var Obj = Sys["Process"]("MyApplication");
  
  // Obtains the fields collection
  var FieldCol = aqObject["GetFields"](Obj);
  
  while ( FieldCol["HasNext"]() )
    Log["Message"]( FieldCol["Next"]()["Name"] );
  
}

See Also

aqObjIterator Object

Highlight search results