ExcelDriver method to create a DDT driver for a sheet of an Excel document. You can use this driver to iterate through the rows of the sheet, obtain values stored in its cells and use these values in your data-driven tests.
DDT.ExcelDriver(FileName, Sheet, UseACEDriver)
|UseACEDriver||[in]||Optional||Boolean||Default value: False|
The method is applied to the following object:
The method has the following parameters:
String that holds the fully qualified name of the Excel document.
String that specifies the name of the desired sheet.
If this parameter is True, TestComplete uses the ACE driver to connect to the specified Excel sheet. If the parameter is False, TestComplete connects to the sheet via the Microsoft Excel ODBC driver.
The ACE driver lets you connect to Excel 2007 - 2013 sheets as well as to sheets created in earlier version of Microsoft Excel. The ODBC driver does not support Excel 2007 - 2013. If you have Excel 2007, 2010 or 2013 installed on your workstation, it is recommended that you use the ACE driver.
The 64-bit version of TestComplete ignores this parameter and always uses the 64-bit version of the ACE driver, as if the parameter is set to true. There is no 64-bit version of the ODBC driver, so it can be used with the 64-bit version of TestComplete.
For information on specifics of using these drivers, see Using Excel Files as Data Storages.
DDTDriver object that provides access to data stored in an Excel sheet.
DDT object is available only if the Data-Driven Testing plugin is installed.
For information on working with DDT drivers, see Using DDT Drivers.
For information on specifics and limitations of the Excel DDT driver, see Using Excel Files as Data Storages.
The code below creates a new Excel driver and gets access to its methods and properties via the
def CurDriverExample(): # Creates a driver DDT.ExcelDriver("C:\\MyFiles\\MyFile.xls", "Sheet1") # Iterates through records while not DDT.CurrentDriver.EOF(): # Gets a value from the storage and posts it to the log Log.Message(DDT.CurrentDriver.Value) DDT.CurrentDriver.Next() # Closes the driver DDT.CloseDriver(DDT.CurrentDriver.Name)