Name Property

Applies to TestComplete 14.91, last modified on July 20, 2021

Description

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

Declaration

aqObjMethodObj.Name

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

Applies To

The property is applied to the following object:

Property Value

A string that holds the method name.

Example

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

JavaScript, JScript

function GettingMethods()
{

  // Launches notepad.exe
  WshShell.Run("notepad.exe", SW_NORMAL);
  
  // Specifies the object
  var Obj = Sys.Process("notepad").Window("Notepad", "Untitled - Notepad", 1);
  
  // Obtains the methods collection
  var MethCol = aqObject.GetMethods(Obj);
  
  while (MethCol.HasNext() )
  {
    var Item = MethCol.Next();
    // Posts the method's name to the test log
    Log.Message(Item.Name);
  }
  
  // Closes notepad.exe
  Sys.Process("notepad").Terminate();
    
}

Python

def GettingMethods():
  # Launches notepad.exe
  WshShell.Run("notepad.exe", SW_NORMAL)
  # Specifies the object
  Obj = Sys.Process("notepad").Window("Notepad", "Untitled - Notepad", 1)
  # Obtains the methods collection
  MethCol = aqObject.GetMethods(Obj)
  while MethCol.HasNext():
    Item = MethCol.Next()
    # Posts the method's name to the test log
    Log.Message(Item.Name)
  # Closes notepad.exe
  Sys.Process("notepad").Terminate()

VBScript

Sub GettingMethods

  ' 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 methods collection
  Set MethCol = aqObject.GetMethods(Obj)
  
  While MethCol.HasNext
    Set Item = MethCol.Next
    ' Posts the method's name to the test log
    Log.Message(Item.Name)
  WEnd
  
  ' Closes notepad.exe
  Sys.Process("notepad").Terminate
    
End Sub

DelphiScript

function GettingMethods;
var Obj, MethCol, Item;
begin

  // Launches notepad.exe
  WshShell.Run('notepad.exe', SW_NORMAL);
  
  // Specifies the object
  Obj := Sys.Process('notepad').Window('Notepad', 'Untitled - Notepad', 1);
  
  // Obtains the methods collection
  MethCol := aqObject.GetMethods(Obj);
  
  while (MethCol.HasNext() ) do
  begin
    Item := MethCol.Next();
    // Posts the method's name to the test log
    Log.Message(Item.Name);
  end;
  
  // Closes notepad.exe
  Sys.Process('notepad').Terminate();
    
end;

C++Script, C#Script

function GettingMethods()
{

  // Launches notepad.exe
  WshShell["Run"]("notepad.exe", SW_NORMAL);
  
  // Specifies the object
  var Obj = Sys["Process"]("notepad")["Window"]("Notepad", "Untitled - Notepad", 1);
  
  // Obtains the methods collection
  var MethCol = aqObject["GetMethods"](Obj);
  
  while (MethCol["HasNext"]() )
  {
    var Item = MethCol["Next"]();
    // Posts the method's name to the test log
    Log["Message"]( Item["Name"] );
  }
  
  // Closes notepad.exe
  Sys["Process"]("notepad")["Terminate"]();
    
}

See Also

HasRetValue Method
ParamCount Property
ParamName Property
ParamType Property
ValueType Property

Highlight search results