JackSparrow
10 years agoFrequent Contributor
How to call the data to a particular function from DDT Record Data in Python
Hi All,
I have used this particular code to call the data from the Excel i.e
RecNo = 0
#Posts data to the log (helper routine)
def ProcessData():
global RecNo
Fldr = Log.CreateFolder("Record: " + aqConvert.VarToStr(RecNo))
Log.PushLogFolder(Fldr)
for i in range(DDT.CurrentDriver.ColumnCount):
Log.Message(DDT.CurrentDriver.ColumnName[i] + ": " + aqConvert.VarToStr(DDT.CurrentDriver.Value[i]))
Log.PopLogFolder()
RecNo = RecNo + 1
# Creates the driver (main routine)
def TestDriver():
global RecNo
# Creates the driver
# If you connect to an Excel 2007 sheet, use the following method call:
# Driver = DDT.ExcelDriver("C:\\MyFile.xlsx", "Sheet1", True);
Driver = DDT.ExcelDriver("C:\\Book1.xls", "Sheet1",True)
RecNo = 0
while not Driver.EOF() :
# Processes data
ProcessData()
# Goes to the next record
Driver.Next()Am able to get the Data record wise
Now how to call this data to a testcase function i use in different Unit
Please guide me