Forum Discussion

krkarthik_info's avatar
krkarthik_info
Frequent Contributor
7 years ago

Can we add a test items into the project throgh script

Hi All,

 

I would like to know if there is any way where we can add test items into the project through script?

 

TIA.

 

Thanks,

Karthik K R

4 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Generally speaking, this is not possible.

    If you really need it, you can create a stand-alone script that will process project .mds file and modify it. Then start TestComplete and trigger tests run. The above project file modification is absolutely on your own risk and, most probably, it will work for the given version of TestComplete only and will require modification for the next version as the internal structure of the project service files is not documented and is the subject to change pretty often.

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Agree with AlexKaras... yes, you CAN do it... but I would not recommend it.  TestItems are what are executed by the test and are, in a sense, "compiled" into the test run when you click the "Run" button.  So, there's no built in way in TestComplete to modify or update the TestItems during the course of a test run.

       

      If you have need of a more dynamic way of determining script/test execution, I would suggest you move away from using TestItems to determine test execution and start building your own custom framework structure which contains the logical decisions to determine what tests get run and when.

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        krkarthik_info Tell us what you want to accomplish by adding test items through a script.  How is this helpful to your testing?  Maybe someone here has another way to do the same thing.

    • krkarthik_info's avatar
      krkarthik_info
      Frequent Contributor

      Hi Alex.

       

      Thanks for your suggestion. 

       

      I really feel it will required lot of effort to do it work for adding test items into the project through modification of project.mds file. And I believe that is not a reliable solution as well.

       

      It would be great if SmartBear itself is providing this option for addding test items through script. Can make it as a feature request.

       

      Thanks,

      Karthik K R