JackSparrow
9 years agoFrequent Contributor
Reading the Test-Case and Test-Data from Excel Using Python
Hii All
My Aim is to Read the Execution Col if its Yes then it need to Take the values of that particular row and call those functions :
Now for the first when am Trying to Read data from excel I have coded this from the Test-Complete Article
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(): # Creates the driver # If you connect to an Excel 2007 sheet, use the following method call: Driver = DDT.ExcelDriver("C:\\DriverSheet.xls", "TestStep",True) # Iterates through records while not Driver.EOF(): ProcessData(); # Processes data Driver.Next(); # Goes to the next record # Closes the driver DDT.CloseDriver(Driver.Name);
But the OutPut of this Displaying as Record 1 Record 2 ....Record4 that's it .
Where did i went wrong or else do i need to add something else to the above code
The example is creating folders in the log file called Record: 0, Record: 1, etc.
Expand the folders to see the values.