Forum Discussion

maxthomassin's avatar
maxthomassin
Occasional Contributor
12 years ago

Using Command Line

Hey,



im trying to use cmd line to run a specific script and later i will need to pass argument to the script.



I've beent trying many line, but i think this one is the closest to the solution :

   "C:\Program Files\Automated QA\TestComplete 7\Bin\TestComplete.exe"    "C:\FINALE\SIPAD\SIPAD_TESTCOMPLETE.pjs" /r /p:Automatisation des Tests /t"Script|Moteur_Test_Automatise|Main"



TestComplete start, but the script aint running. I attached a picture of my project tree.






  • Hi again Maxime.




     



    If you want to pass some parameters, you should take a look at the following page : 




    Here is an example you could use : 


    function CommandLineArgs()


    {


      var nArgs = BuiltIn.ParamCount();


      Log.Message("Total number of command-line arguments: " + nArgs);


      Log.Message("The fully-qualified name of the TestComplete executable: " + BuiltIn.ParamStr(0));


     


      for (var i = 1; i <= nArgs ; i++)


        Log.Message("Arg " + i + ": " + BuiltIn.ParamStr(i));


    }



  • maxthomassin's avatar
    maxthomassin
    Occasional Contributor
    I forgot to mention that i use TestComplete 7 and im testing web application. 




  • Salut Maxime.


     


    You should add quotes " in between Automatisation des Tests" because my guess is, TestExecute is actually trying to run the 'Automatisation' project which does not exists in your suite.


     


    "C:\Program Files\Automated QA\TestComplete 7\Bin\TestComplete.exe"    "C:\FINALE\SIPAD\SIPAD_TESTCOMPLETE.pjs" /r /p:"Automatisation des Tests"  /t"Script|Moteur_Test_Automatise|Main"


     


    Regards, 


     


    Guillaume

  • maxthomassin's avatar
    maxthomassin
    Occasional Contributor
    Thanks for the reply, but it still not working. I renamed the projet with Automatisation_des_Tests. The line open TestComplete and open the project suite and the project, but after, nothing happen.



    I think what is not working is the last section : /t"Script|Moteur_Test_Automatise|Main"



    In my tree (you can also look the picture I attached on the initial post), I have : Script, then the folder Scenario and then my script.
  • maxthomassin's avatar
    maxthomassin
    Occasional Contributor
    I just figured out. The example is not working, but I the I followed the command line signature and its working. 



    "C:\Program Files\Automated QA\TestComplete 7\Bin\TestComplete.exe"    "C:\FINALE\SIPAD\SIPAD_TESTCOMPLETE.pjs" /run /project:Automatisation_des_Tests /unit:Moteur_Test_Automatise /routine:Main





  • maxthomassin's avatar
    maxthomassin
    Occasional Contributor
    The only thing i need to find out now, its to pass parameter the my main

  • Hi again Maxime.




     



    If you want to pass some parameters, you should take a look at the following page : 




    Here is an example you could use : 


    function CommandLineArgs()


    {


      var nArgs = BuiltIn.ParamCount();


      Log.Message("Total number of command-line arguments: " + nArgs);


      Log.Message("The fully-qualified name of the TestComplete executable: " + BuiltIn.ParamStr(0));


     


      for (var i = 1; i <= nArgs ; i++)


        Log.Message("Arg " + i + ": " + BuiltIn.ParamStr(i));


    }