Forum Discussion
What I've done in the past to configure things to run differently on different machines is created an INI file in some directory for the machine in question. I would then make my setting changes in that INI file and let it remain permanently on that machine. At the beginning of a test run, I had code that would read that INI file and then update Project variables to the values in the INI. This would then set up the environment for the test run.
Another option you have is to use a custom commandline parameter. In order to do so, you need to write code to be able to read that command line parameter and utilize it within you tests. I created a script extension not too long ago that contains this code.
https://bitbucket.org/privateteamogre/scriptextensions/downloads/OgreUtilities.tcx
If you have any questions on how to use that utility, let me know via PM.
Thanks for the reply!
I'm thinking the INI route may be the better way to go. Could you provide an example (or offer any additional insight) in the INI file? Specifically, the code that I would need to have in place to read the INI file and update the URL variable to the value in the INI file. Thanks!
- tristaanogre8 years agoEsteemed Contributor
I'd start first with familiarizing yourself with the Storages.INI method. (https://support.smartbear.com/testcomplete/docs/reference/program-objects/storages/ini.html). This is what you can use to create an object reference to the INI file. There's a bunch of sample code in that article and in related articles for FileSection object (https://support.smartbear.com/testcomplete/docs/reference/program-objects/filesection/index.html) that show how to read values from an INI file and utilize them within your tests.
If you can't construct the code yourself, let us know and we'll put an example together.