Forum Discussion

underqualified's avatar
underqualified
Occasional Contributor
5 years ago

Execute a TestComplete script from an .exe with predefined variables?

Hey all, I'd like to set up a .exe that automatically runs my test script, and I need the exe to supply a few variables. How would I do that?

  • Hey,

     

    I assume you will run this .exe with cmd so you can run it with cmd in this way:

    "C:\Program Files (x86)\SmartBear\TestComplete 14\Bin\TestComplete.exe" "C:\work\testComplete\your_app.pjs" /r /p:project_name /param1:param1Val /param2:param2Val

    You can see adding new variables from cmd in this thread:

    setting-and-using-variable-within-same-command-line-in-windows-cmd-exe 

     

    Additionally you can add values of variables in "TestedApps" of the project or if you use Jenkins' CI you can pass them also as values in cmd.

     

    Reading the transmitted values from cmd can be done by using the TestComplete class named BuiltIn

     

    BuiltIn.ParamStr(i)...

     

  • Wamboo's avatar
    Wamboo
    Community Hero

    Hey,

     

    I assume you will run this .exe with cmd so you can run it with cmd in this way:

    "C:\Program Files (x86)\SmartBear\TestComplete 14\Bin\TestComplete.exe" "C:\work\testComplete\your_app.pjs" /r /p:project_name /param1:param1Val /param2:param2Val

    You can see adding new variables from cmd in this thread:

    setting-and-using-variable-within-same-command-line-in-windows-cmd-exe 

     

    Additionally you can add values of variables in "TestedApps" of the project or if you use Jenkins' CI you can pass them also as values in cmd.

     

    Reading the transmitted values from cmd can be done by using the TestComplete class named BuiltIn

     

    BuiltIn.ParamStr(i)...