-1

I have several tests that can use several excel data files.

Now, each time that a need to change the data excel file for a test... I need to do it mannually in UFT.

My idea is to have a simple configuration file (txt), that will define what data excel file to use on the actual run of the actual test.

Thanks

1 Answers1

0

QTP's design lends well to stackable parameterization... For example here, you can use parameterization to control your parameterization ;)

'where Config.xls is an excel file with a tab/sheet called "Config" and a column called "Filename" that contains the filenames of the workbooks containing the data.

DataTable.AddSheet "Config"
DataTable.ImportSheet ("Config", "c:\Automation\Config.xls")

DataTable.AddSheet "Data"
DataTable.ImportSheet (DataTable("Filename","Config"), "Data", "Data") 'this assumes the data is on a sheet called "Data" in the excel file, and it ends up in the datatable as a sheet called "Data" 

Or, you could even put all the data in one workbook on different sheets and include a column that names the data sheets...

DataTable.AddSheet "Config"
DataTable.ImportSheet ("Config", "c:\Automation\Config.xls")

DataTable.AddSheet "Data"
DataTable.ImportSheet (DataTable("Filename","Config"), DataTable("Sheetname","Config"), "Data")

So, you setup your test by editing Config.xls to control which datasheet ends up in the "Data" sheet in the QTP datatable :)

Trimble Epic
  • 466
  • 1
  • 3
  • 15