Name Property

Applies to TestComplete 15.70, last modified on December 17, 2024

Description

Use Name to obtain the name of the object property that the given aqObjPropertyObj object provides information about.

Declaration

aqObjPropertyObj.Name

Read-Only Property String
aqObjPropertyObj An expression, variable or parameter that specifies a reference to an aqObjProperty object

Applies To

The property is applied to the following object:

Property Value

A string that holds the property name.

Example

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

JavaScript, JScript

function GetProperties()
{

  // Launches notepad.exe
  WshShell.Run("notepad.exe", SW_NORMAL);
  
  // Specifies the object
  var Obj = Sys.Process("notepad").Window("Notepad", "Untitled - Notepad", 1);
  
  // Obtains the collection of properties
  var PropCol = aqObject.GetProperties(Obj);
  
  // Posts the properties names to the test log
  while ( PropCol.HasNext() )
  {
    var PropItem = PropCol.Next();
    Log.Message(PropItem.Name);
  }
  
  // Closes notepad.exe
  Sys.Process("notepad").Terminate();

}

Python

def GetProperties():
  # Launches notepad.exe
  WshShell.Run("notepad.exe", SW_NORMAL)
  # Specifies the object
  Obj = Sys.Process("notepad").Window("Notepad", "Untitled - Notepad", 1)
  # Obtains the collection of properties
  PropCol = aqObject.GetProperties(Obj)
  # Posts the properties names to the test log
  while PropCol.HasNext():
    PropItem = PropCol.Next()
    Log.Message(PropItem.Name)
  # Closes notepad.exe
  Sys.Process("notepad").Terminate()

VBScript

Sub GetProperties

  ' Launches notepad.exe
  Call WshShell.Run("notepad.exe", SW_NORMAL)
  
  ' Specifies the object
  Set Obj = Sys.Process("notepad").Window("Notepad", "Untitled - Notepad", 1)
  
  ' Obtains the collection of properties
  Set PropCol = aqObject.GetProperties(Obj)
  
  ' Posts the properties names to the test log
  While PropCol.HasNext
    Set PropItem = PropCol.Next
    Log.Message PropItem.Name
  WEnd
  
  ' Closes notepad.exe
  Sys.Process("notepad").Terminate

End Sub

DelphiScript

function GetProperties;
var Obj, PropCol, PropItem;
begin

  // Launches notepad.exe
  WshShell.Run('notepad.exe', SW_NORMAL);
  
  // Specifies the object
  Obj := Sys.Process('notepad').Window('Notepad', 'Untitled - Notepad', 1);
  
  // Obtains the collection of properties
  PropCol := aqObject.GetProperties(Obj);
  
  // Posts the properties names to the test log
  while ( PropCol.HasNext() ) do
  begin
    PropItem := PropCol.Next();
    Log.Message(PropItem.Name);
  end;
  
  // Closes notepad.exe
  Sys.Process('notepad').Terminate();

end;

C++Script, C#Script

function GetProperties()
{

  // Launches notepad.exe
  WshShell["Run"]("notepad.exe", SW_NORMAL);
  
  // Specifies the object
  var Obj = Sys["Process"]("notepad")["Window"]("Notepad", "Untitled - Notepad", 1);
  
  // Obtains the collection of properties
  var PropCol = aqObject["GetProperties"](Obj);
  
  // Posts the properties names to the test log
  while ( PropCol["HasNext"]() )
  {
    var PropItem = PropCol["Next"]();
    Log["Message"]( PropItem["Name"] );
  }
  
  // Closes notepad.exe
  Sys["Process"]("notepad")["Terminate"]();

}

See Also

Access Property
ParamCount Property
ParamName Property
Value Property

Highlight search results