I would like to know if there is any way where we can add test items into the project through script?
Karthik K R
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.
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.
Karthik K R
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.
@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.