Forum Discussion

MichaelMcFarlan's avatar
MichaelMcFarlan
Contributor
14 years ago

Set a global TestedApps file

I have a big project with around 50 sub projects in it. Each of those have their own scripts and "TestedApps" section. I was wondering if there is a way to set the TestedApps file to a project variable. Reasoning behind this is that I am editing all these scripts on my 64bit computer where the TestedApp in question installs somewhere different then the computer where they will regularly be running once I finish up editing them. As it is currently I will have to go through all 50 projects and change the TestedApp location of the program I am testing when I want to run them on the other computer.



The solution doesn't have to be what I suggested, I just think that would be the simplest way from my small knowledge of TestComplete. However, it looks like the Tested App file can only be a string. If I could get some help or a pointer in the right direction that would be great.



Michael

8 Replies

  • I found a slightly ghetto solution. 



    What I did was create the TestedApps item each time and then delete at the end of the script. When I create I use ProjectSuite.Variable.MainProjectPath.. which means when I run this on the other computer I will just need to change the project variable instead of each specific path.



    If anyone has a solution that is more elegant than this one please let me know.
  • Hello Michael,




    Since the TestedApps item cannot be shared among projects, your solution is quite acceptable. Probably, you prefer not to change the TestedApps collection while running tests. Another solution is to run necessary applications directly, without using the TestedApps item:







      var  path = ProjectSuite.Variables.VariableByName(<application path>);


      var shell = new ActiveXObject("WScript.Shell");


      shell.Run(path);






    However, this solution doesn't use advanced run options such as Run Modes.


    As for the ability to share the TestedApps collection among projects of the same project suite, we have this suggestion in our DB, and your post has increased its rating. Thank you.
  • Alex,



    Please increment the database request by one more. I would use this function the moment it became available.



    In the meantime I might use the "ghetto solution" elegantly written above. Thanks to the original poster.



    Chuck



  • Hello Chuck,





    As far as I can see, we have already increased the rating of the suggestion in response to your post in this 

    thread. Thank you.
  • zakyn's avatar
    zakyn
    Occasional Contributor
    Hi Alex,



    Please increment the database request by one more. This would be very useful function for me.



    Thanks.



    Vladimir

  • Hello Vladimir,





    Thank you for the request. I have increased the rating of the corresponding suggestion.
  • mpapler's avatar
    mpapler
    New Contributor
    Hello,

     

    Is there any news about implementing all suggestions?



    I prefer to set it as global variable or global "TeststedApps"



    Best,

    Matej