santoguya
15 years agoContributor
passing in variables from command line to use in testcomplete
Hi,
So I want to be able to run one of my projects on multiple operating systems, where path/directory structures and credentials will be different. I developed my TestComplete test in Windows Xp so the TestedApps locations all point to C:\Program Files\, and for Win7 I need it to point to C:\Program Files (X86)\.
Therefore I want to modify my cmd script to call Project.pjs with some parameters that modify some type of global variable inside my test script that will be used in the pathing of my Tested Apps.
For instance, if I use a global variable PROGRAM_FILES_PATH, i want to do something like:
1. In cmd, call Project.pjs PROGRAM_FILES_PATH="C:\Program Files\"
2. In my TestComplete project, have a global variable named PROGRAM_FILES_PATH that can be modified by 1.)
3. In TestedApps for all of the applications I want to run, use the variable PROGRAM_FILES_PATH
I see that you can specify Temporary Variables and Persistent Variables when you right click on your project and edit Variables; is persistent variable a global variable?
Is this functionality possible? If possible, please provide some example code or a tutorial of some sort.
Thanks!
So I want to be able to run one of my projects on multiple operating systems, where path/directory structures and credentials will be different. I developed my TestComplete test in Windows Xp so the TestedApps locations all point to C:\Program Files\, and for Win7 I need it to point to C:\Program Files (X86)\.
Therefore I want to modify my cmd script to call Project.pjs with some parameters that modify some type of global variable inside my test script that will be used in the pathing of my Tested Apps.
For instance, if I use a global variable PROGRAM_FILES_PATH, i want to do something like:
1. In cmd, call Project.pjs PROGRAM_FILES_PATH="C:\Program Files\"
2. In my TestComplete project, have a global variable named PROGRAM_FILES_PATH that can be modified by 1.)
3. In TestedApps for all of the applications I want to run, use the variable PROGRAM_FILES_PATH
I see that you can specify Temporary Variables and Persistent Variables when you right click on your project and edit Variables; is persistent variable a global variable?
Is this functionality possible? If possible, please provide some example code or a tutorial of some sort.
Thanks!