Forum Discussion

dpiotrowski's avatar
dpiotrowski
Contributor
13 years ago

Parameterizing the whole project?

Hello there!



I create a test project for an application which should be tested in 6 different versions depending on 2 paramters (platform: 64 and 86 and version: pro, lite, student, so for example I test: lite 64, lite 32, pro 64 and so on...). I created parameterized tests with these 2 parameters (platform, version), and what I'd like to do now is to insert these tests into the Project Test Items Page once and run them 6 times with different parameters for every version. I'd like to execute first all the tests with parameters for one version, then when it's all done change the paramaters and do the same for differenet version and so on. For now I can only do these by inserting manually the tests into the Test Items Page and giving paramters for one version, then copy all the items and paste them with different parameters. This is inconvenient. Is there something like project parameters, so I can insert the Test Items once and then run them with different parametrs depedning on project parameters? I'd like to simply insert all the tests to the project Test Items Page and then in the Project Suite page tell Test Complete to execute thisproject 6 times with different parameters (these parameters would correspond to the parameters in the tests).



Can you help me on this one?
  • It's been a long time since I looked at this, but I think either the "Using DDT Drivers" or "Data-driven loops" help content might be a starting point for you.
  • Daniel,



    You can create project variables that will store the platform and version values. You can assign the needed values to these variables before running your tests.



    Alternatively, you can run TestComplete via the command line and pass the needed values as command-line arguments. 


    You can specify any arguments in the command line. TestComplete will process only the arguments it supports (e.g. the project file name). All the others can be used in your tests. To determine the number and argument values, use the BuiltIn.ParamCount property and the BuiltIn.ParamStr method.
  • Thank you for your replies.



    I was thinking about using project variables, but the question now is how can I execute/loop the whole project 6 times, each time with different combinations of these variables. Please take a look at the attached picture - this is a simple project performing installation/deinstallation on lit86 version, the inst/deinst functions take parameters, but in this case these parameters are hard coded. Even when I specify project variables with values professsional, lite, student and 86,64 how do I loop the whole project so I don't have to copy/paste the tests added to the project but smply make TestComplete execute the whole project with the first configuration of these 2 parameters, then the second and so on (the items "Lite86 Installation" and "Lite86 Deinstallation" would be then simply "Installation" and "Deinstallation" but with different parameters).
  • Any ideas if this can be accomplished? The goal is to create the project items list only once (with parameters instead of the hard coded values) and then run the whole project with different paramter combinations (I can see how this can be done for a single keyword test but not for the whole project)
  • quote]I was thinking about using project variables, but the question now is how can I execute/loop the whole project 6 times, each time with different combinations of these variables.[/quote]


    If you run TestComplete via the command line, run it six times, each time passing the needed values as command-line arguments. In the test that runs first, you can analyze the command-line arguments with the ParamCount property and the BuiltIn.ParamStr method and assign the appropriate values to the project variables.


    Alternatively, create a keyword test or script routine that will call all the other tests and run this test (script) as many times as you need.

  • Thank you once again, Alex, it works exactly as I wanted! I used the 2nd solution - that is I created one big keyword test with all the tests in it that I want to run. Then in the Project Items list I added this big keyword test 6 times, each time with different parameters.