Forum Discussion

JonoW's avatar
JonoW
Occasional Contributor
13 years ago

Help with Paths to Binaries please(!)

Hi,



I have run into a problem.... here goes my attempt to explain:

On my development machine, our source code tree lives in f:\devel\<stuff>\source\tests\test complete tests\<my TC projects>

The binaries for our project get dumped in f:\devel\<stuff>\binaries. I have a mapped drive (Z:) pointing at the <stuff> folder.



In my TestComplete tests I have the following in my "Globals" script:

var LocalStoragePath = "Z:\\Binaries\\";       



Then I do:

MyApp["Path"] = Globals["LocalStoragePath"];  



This works great.



We also have a build server that used to run the TestComplete tests automatically after each successful build of the software, which happened when anybody checked in their code. 



To enable the tests to run on the build server, I have another var in the Globals script:

var BuildServerStoragePath = C:\\Builds\\5\\<whatever the path is>\\Binaries\\;



This is where the build server outputs the binaries to. In my main App startup script, I test for the existence of this path, and if it is found, I change MyApp["Path"] to point to this. It works ok; if the build is running on my local dev machine it runs it from Z:\Binaries, otherwise it must be running on the build server, so it runs it from there. 



However the entire suite of UI tests now takes about 50 mins to run, which is too long to run every check in. 



We have created a new build definition that runs at 3am every night. This runs the UI tests. It was pointing at the Check In Builds binaries folder. I have now changed it to point to the Nightly build Binaries folder, just by changing where the BuildServerStoragePath is pointing. 



Considering that we might want to to add more build definitions that run All/Some of the UI tests... how can I choose which binaries folder I want to run from? It won't always be the same one... 



I hope this makes sense. 


3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    I believe you can add command line parameters to TestComplete and then parse them out.  I don't have the code right at hand but, in your calls from the build box, you can pass those params in and have TC parse it out.  



    Here, check it out (found it)



    http://smartbear.com/support/viewarticle/9021/
  • Hi Jono,



    In addition to Robert's answer, I can suggest you checking the name of the current machine and choosing the needed path depending on it in the beginning of your tests. You can get this name via the Sys.HostName property.
  • JonoW's avatar
    JonoW
    Occasional Contributor
    Hey guys, 



    Thanks for the suggestions! - will give them a go :)