Forum Discussion
simon_glet
13 years agoRegular Contributor
There is a way to change Project.Variables before running a test:
By invoking the following generic function with RunRoutineEx from the COM interface:
function setProjectVariable(aVariableName, aValue)
{
Log.Message("Before Setting value");
Log.Message("Project.Variables." + aVariableName + " = " + eval("Project.Variables." + aVariableName +";"));
eval("Project.Variables." + aVariableName + "=" + '"' + aValue + '"' + ";");
Log.Message("After Setting value");
Log.Message("Project.Variables." + aVariableName + " = " + eval("Project.Variables." + aVariableName +";"));
}
The project variables values will remain as long as the project is loaded.
To set 10 variables you will have to invoke the function 10 times. There is no way to have a variable number of function arguments through the COM interface.
Sincerely
Simon Glet
By invoking the following generic function with RunRoutineEx from the COM interface:
function setProjectVariable(aVariableName, aValue)
{
Log.Message("Before Setting value");
Log.Message("Project.Variables." + aVariableName + " = " + eval("Project.Variables." + aVariableName +";"));
eval("Project.Variables." + aVariableName + "=" + '"' + aValue + '"' + ";");
Log.Message("After Setting value");
Log.Message("Project.Variables." + aVariableName + " = " + eval("Project.Variables." + aVariableName +";"));
}
The project variables values will remain as long as the project is loaded.
To set 10 variables you will have to invoke the function 10 times. There is no way to have a variable number of function arguments through the COM interface.
Sincerely
Simon Glet