Forum Discussion

kirk_bottomley's avatar
kirk_bottomley
Contributor
9 years ago
Solved

Assigning Variable Values to Remote Machines

Our test structure is one authoring machine writing tests using TestComplete, and TestExecute licenses on the machines that will run the tests. Each machine can install the software to any AppPath, a...
  • kirk_bottomley's avatar
    9 years ago

    I figured out a solution.

     

    You can't assign the value of a persistent variable to a persistent variable, it seems. But you can assign a temporary variable to one.

     

    So simply...

     

    function AssignVariables(VarName)
    {
    var MachineName = VarName + "_" + aqString.Replace(Sys.HostName, "-", "");
    Project.Variables.VariableByName(VarName) = Project.Variables.VariableByName(MachineName);
    }

    ...allows me to populate the Temporary Variables section with Variable_Machine-0123, call the routine as needed, and pass in the variable name to be assigned. Then I can just continue using the original variable in the rest of the tests and scripts.

     

    I know the better way would be to maintain a database or XML file with the machine names and their needed values, but until that is implemented, this will work.

    Thank you everyone who responded trying to help. Much appreciated.