Name Property

Applies to TestComplete 14.71, last modified on April 22, 2021

Description

Use the Name property to get or set the name of the ProgObj driver.

Declaration

ProgObj.Name

Read-Write Property String
ProgObj An expression, variable or parameter that specifies a reference to one of the objects listed in the Applies To section

Applies To

The property is applied to the following object:

Property Value

String specifying the driver name.

Example

The code below creates two Excel drivers, then obtains their names and posts these names to the test log.

JavaScript, JScript

function DDTDriverName()
{
  // Specifies two new Excel drivers
  var Driver = DDT.ExcelDriver("C:\\MyFiles\\1.xls", "SheetName");
  var Driver1 = DDT.ExcelDriver("C:\Work\\TestData.xls", "Test1_Data");
  // ...
  
  // Posts the drivers' names to the test log
  Log.Message(Driver.Name); // Excel0
  Log.Message(Driver1.Name); // Excel1
}

Python

def DDTDriverName():
  # Specifies two new Excel drivers 
  Driver = DDT.ExcelDriver("C:\\MyFiles\\1.xls", "SheetName")
  Driver1 = DDT.ExcelDriver("C:\Work\\TestData.xls", "Test1_Data")
  # ... 
  # Posts the drivers' names to the test log  
  Log.Message(Driver.Name) # Excel0 
  Log.Message(Driver1.Name) # Excel1

VBScript

Sub DDTDriverName

  ' Specifies two new Excel drivers
  Set Driver = DDT.ExcelDriver("C:\MyFiles\1.xls", "SheetName")
  Set Driver1 = DDT.ExcelDriver("C:Work\TestData.xls", "Test1_Data")
  ' ...
  
  ' Posts the drivers'' names to the test log
  Log.Message(Driver.Name) ' Excel0
  Log.Message(Driver1.Name) ' Excel1
  
End Sub

DelphiScript

function DDTDriverName;
var Driver, Driver1;
begin

  // Specifies two new Excel drivers
  Driver := DDT.ExcelDriver('C:\MyFiles\1.xls', 'SheetName');
  Driver1 := DDT.ExcelDriver('C:Work\TestData.xls', 'Test1_Data');
  // ...
  
  // Posts the drivers' names to the test log
  Log.Message(Driver.Name); // Excel0
  Log.Message(Driver1.Name); // Excel1

end;

C++Script, C#Script

function DDTDriverName()
{
  // Specifies two new Excel drivers
  var Driver = DDT["ExcelDriver"]( "C:\\MyFiles\\1.xls", "SheetName" );
  var Driver1 = DDT["ExcelDriver"]( "C:\Work\\TestData.xls", "Test1_Data" );
  // ...
  
  // Posts the drivers' names to the test log
  Log["Message"]( Driver["Name"] ); // Excel0
  Log["Message"]( Driver1["Name"] ); // Excel1
}

See Also

Using DDT Drivers
DriverByName Property

Highlight search results