Forum Discussion

maxqiu's avatar
maxqiu
Occasional Contributor
6 years ago
Solved

command line

hi everyone,

I tried to connect Jenkins with TestComplete. I would like to know how could I change the test variable in the Jenkins, instead of  changing in the Testcomplete VMs. I would like to pass a temporary variable defined in TestComplete as a parameter in Jenkins. To make TestComplete recognize such custom parameters

Thanks

  • There is no easy built in way in TestComplete on the command line to say "Use this value in the parameter for this test" or anything like that.

     

    There are ways of doing so, however.  One way is, if you go to https://github.com/smartbear-testcomplete/ogre-utilities/tree/master/Releases/Latest and download the tcx file, this is a script extension bundle that I developed for various utilities and such.  It has a method called getTCCommandLineParameter. Pass in to that method the parameter name you want to parse out, and it will retrieve that for use in your project.

     

    Another way that I've used in the past is that, instead of passing in parameters in the commandline, I've created a config file (an INI type text file) that resides in the folder with my project.  The first thing that my project does, then, is read that INI file and update Project variables (Project.Variables) with the appropriate values from that INI.  If I want to change the values for some reason, I simply update the INI.

     

    These are just two ways of doing it... I'm sure there are others.

  • This is all in TestComplete.  All Jenkins does is execute the command line.  Everything I indicated are code alterations you'll need to make to your TestComplete project to accommodate "custom" parameterization.

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    There is no easy built in way in TestComplete on the command line to say "Use this value in the parameter for this test" or anything like that.

     

    There are ways of doing so, however.  One way is, if you go to https://github.com/smartbear-testcomplete/ogre-utilities/tree/master/Releases/Latest and download the tcx file, this is a script extension bundle that I developed for various utilities and such.  It has a method called getTCCommandLineParameter. Pass in to that method the parameter name you want to parse out, and it will retrieve that for use in your project.

     

    Another way that I've used in the past is that, instead of passing in parameters in the commandline, I've created a config file (an INI type text file) that resides in the folder with my project.  The first thing that my project does, then, is read that INI file and update Project variables (Project.Variables) with the appropriate values from that INI.  If I want to change the values for some reason, I simply update the INI.

     

    These are just two ways of doing it... I'm sure there are others.

    • maxqiu's avatar
      maxqiu
      Occasional Contributor

      Hi

       

       Thanks for the answer, and I would like to I do those steps in the Jenkins or Testcomplete?

       

      Best Regards

       

      Wenyang

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        This is all in TestComplete.  All Jenkins does is execute the command line.  Everything I indicated are code alterations you'll need to make to your TestComplete project to accommodate "custom" parameterization.