Forum Discussion
tristaanogre
14 years agoEsteemed Contributor
As noted in that thread, there's no easy way to programatically change the source of the data driven loop via a keyword test.
What I would suggest is to create a bit of script code to create a DDT object. Something like:
Then, in your keyword test, where you would normally use your Table data for input, use DDT.CurrentDriver.Value("ColumnName"). This would be wrapped in a while loop while DDT.CurrentDriver.EOF is not equal to true. Within that while loop, you'd call DDT.CurrentDriver.Next. After everthing is done looping, you can then call an Object Method to call DDT.CloseDriver and pass in as the parameter DDT.CurrentDriver.Name.
Take a look at the screenshot attached to see a sketched out loop for this.
What I would suggest is to create a bit of script code to create a DDT object. Something like:
function CreateDDT(CSVFileName)
{
var LocalObject = DDT.CSVDriver(CSVFileName)
}
Then, in your keyword test, where you would normally use your Table data for input, use DDT.CurrentDriver.Value("ColumnName"). This would be wrapped in a while loop while DDT.CurrentDriver.EOF is not equal to true. Within that while loop, you'd call DDT.CurrentDriver.Next. After everthing is done looping, you can then call an Object Method to call DDT.CloseDriver and pass in as the parameter DDT.CurrentDriver.Name.
Take a look at the screenshot attached to see a sketched out loop for this.