Use csv/excel file to update Project Suite/Project variables before running test?
Hi,
I was just wondering if there is a way to update project suite/project variables value using data-driven logic?
It would help non-QA staff to just use file to update all variables and run the test in many environments.
Many Thanks,
Shiva
You can do something like this...........
DDT.ExcelDriver('C:\myVariable.xlsx','sheet1',true);
do {
if (!Project.Variables.VariableExists("DatabaseName"))
{ Project.Variables.AddVariable("DatabaseName", "String") }
Project.Variables.DatabaseName = DDT.CurrentDriver.Value('DBname');
}
while (!(DDT.CurrentDriver.EOF()));
DDT.CloseDriver(DDT.CurrentDriver.Name);As a convenience, you can access a variable in the Variables collection by its name. "varName" is not the name of the variable in the collection.
You probably want
ProjectSuite.Variables.VariableByName(varName) = varValue;