Thanks a lot for your help Jaycon :-). Now the main script seems to work fine, but I have another problem.
I'm using two variables Project.Variables.user and Project.Variables.password which need to be passed between tests. No matter if I define them in the main() or the recursiveTraverse(Level) before the first iteration, I get a printout that they are initialized but once I try to use them from a test in the recursion they are always empty :-(
function main()
{
var Driver;
Driver = DDT.ExcelDriver("c:\\logon.xlsx", "MKD", true);
RecNo = 0;
Project.Variables.user = DDT.CurrentDriver.Value('user');
Log.Message(Project.Variables.user);
Project.Variables.password = DDT.CurrentDriver.Value('password');
Log.Message(Project.Variables.password);
while (!Driver.EOF())
{
recursiveTraverse(Project.TestItems);
Driver.Next();
}
DDT.CloseDriver(Driver.Name);
}
function recursiveTraverse(Level)
{
var Items = Level.ItemCount;
Project.Variables.user = DDT.CurrentDriver.Value('user');
Log.Message(Project.Variables.user);
Project.Variables.password = DDT.CurrentDriver.Value('password');
Log.Message(Project.Variables.password);
var accounts = Database.getAccounts(Project.Variables.user);
for(var i = 0; i <=(Items-1); i++)
{
runTestItemRoutine(Level.TestItem(i));
recursiveTraverse(Level.TestItem(i));
}
}
It doesn't make any difference if they are defined as temporary or persistent either. This really defeats the whole purpose of using project variables for holding data between tests, so i assume I'm doing something wrong this time as well.
Best Regards,
Ilija