Forum Discussion

delis_vassilios's avatar
delis_vassilios
New Contributor
11 years ago

How can I specify "environment-dependent" parameters for a Test Run

The help page:  http://support.smartbear.com/viewarticle/56543/  reads:



"You can use project and project suite variables and network suite variables. The values of these variables depend on the machine where the test is run. In other words, the values of these variables differ from one tester’s computer to another. These variables depend on how their values are shared: project, project suite and network suite"



However I cannot figure out  how to accomplish this. The only options I have when specifying a parameter for a test function are:





How can a project variable be set to be different per TestExecute node, where the project is going to be run?





  • Marsha_R's avatar
    Marsha_R
    Icon for Champion Level 3 rankChampion Level 3
    At the beginning of our test suite, we have code to check the environment and set some project variables.  The tests that need to know about the environment use those variables.  For instance, one of the variables holds our UI version.  Later versions have different buttons in the toolbar, so we can use that variable in a test to know which buttons are available for use.  



    I'm not sure what you're looking for in the drop-down.  In our case, the variables are always the same type, just different content.   You can always pick a Project variable or a Local variable for your parameters.



    The variables can also be different in each different instance of the project that you save, so if you are putting a separate project on each machine you run, then you can set the variables manually and just leave them that way.  That's more specific for each machine but more difficult to maintain.
  • Thanks for the quick response!  I was also leaning towards coding this in a script, in my case every TE node will look for its own values from an excel based on their hostname. You can be quite flexible when scripting and find many ways to accomplish this.



    I was wondering though if there is any solution more 'inherent' to TestComplete, where it will be more clear to everyone who selects test cases to also assign the correct values, rather than having to know the assumptions made inside the code.



    The solution where everyone saves the project with different values, as you also mention, is not really maintenable and I hope its not what was implied in the article when saying that the test parameters can be different per test environment.



    So unless there is any other clarification I will also code the solution.



    Thanks!