Forum Discussion
Marsha_R
11 years agoModerator
Well, DriveMethod can be used directly in a keyword test from Call Object Method in the menu. Start with DDT and step through the wizard it from there.
However, in the 56908 article, look at the end of the VB code example (or see below). It's exactly what's in the keyword while loop example that I posted. You define the driver and tell it what data source to use, then while the driver doesn't run out of data source records, do whatever is in the loop.
If your loop is similar to this, or to my example, then you are already doing DriveMethod. It's just hidden in the keyword definitions.
Sub TestDriver
Dim Driver
' Creates the driver
' If you connect to an Excel 2007 sheet, use the following method call:
' Set Driver = DDT.ExcelDriver("C:\MyFile.xlsx", "Sheet1", True)
Set Driver = DDT.ExcelDriver("C:\MyFile.xls", "Sheet1")
' Iterates through records
RecNo = 0
While Not Driver.EOF()
Call ProcessData() ' Processes data
Call Driver.Next() ' Goes to the next record
WEnd
' Closes the driver
Call DDT.CloseDriver(Driver.Name)
End Sub
However, in the 56908 article, look at the end of the VB code example (or see below). It's exactly what's in the keyword while loop example that I posted. You define the driver and tell it what data source to use, then while the driver doesn't run out of data source records, do whatever is in the loop.
If your loop is similar to this, or to my example, then you are already doing DriveMethod. It's just hidden in the keyword definitions.
Sub TestDriver
Dim Driver
' Creates the driver
' If you connect to an Excel 2007 sheet, use the following method call:
' Set Driver = DDT.ExcelDriver("C:\MyFile.xlsx", "Sheet1", True)
Set Driver = DDT.ExcelDriver("C:\MyFile.xls", "Sheet1")
' Iterates through records
RecNo = 0
While Not Driver.EOF()
Call ProcessData() ' Processes data
Call Driver.Next() ' Goes to the next record
WEnd
' Closes the driver
Call DDT.CloseDriver(Driver.Name)
End Sub
Related Content
- 3 years ago
- 2 years ago
- 6 years ago
Recent Discussions
- 4 days ago
- 4 days ago