Forum Discussion

KRehman's avatar
KRehman
Occasional Contributor
5 years ago

Ability to run same Projects using 2 different database under one Project Suite

Hi Guys, 

 

We have a change in our software and now all Projects need to be run on two different databases. One with new option enabled and other with option disabled. 

 

What is the best way to setup Project suite and not duplicate tests and run with both option enabled and disbaled. 

 

 Also, I need to restore relevant database under each Project when I enable and disable the new option. Is there any global parameter/setting that can help me achieve this output. 

 

I am not sure if I was able to explain properly but please let me know if it doesn't make sense. Happy to explain more. Any help would be appreciated. 

 

Kind Regards,

Komal

  • Hi,

    There are many options available in TestComplete to achieve this.

    1) Project and project set variables
    Use temporary variables to configure a specific environment for your tests. For example:
    a) Create a variable (str) -> "app1".
    b) Send its value by cmd
    c) use onTestStart to perform the correct operation

     

    2) CI - If you are using software like Jenkins, you can always pass the value by cmd and follow step 1.

     

    3) Divide your whole project into two smaller ones and inside it:
    a) Use file references
    b) or If you have a big difference create another project -> copy files to -> and use one nameMapping file with a specific configuration for the value.

     

    4)
    "In addition, I need to restore the appropriate database under each project when I turn on and off the new option. Is there any global parameter/setting that can help me achieve this output".

    Install the correct driver -> connect to DB -> run the script and you are ready to work.

    Remember that you can always store temporary data between tests in an external file like .json or excel file.

  • Wamboo's avatar
    Wamboo
    Community Hero

    Hi,

    There are many options available in TestComplete to achieve this.

    1) Project and project set variables
    Use temporary variables to configure a specific environment for your tests. For example:
    a) Create a variable (str) -> "app1".
    b) Send its value by cmd
    c) use onTestStart to perform the correct operation

     

    2) CI - If you are using software like Jenkins, you can always pass the value by cmd and follow step 1.

     

    3) Divide your whole project into two smaller ones and inside it:
    a) Use file references
    b) or If you have a big difference create another project -> copy files to -> and use one nameMapping file with a specific configuration for the value.

     

    4)
    "In addition, I need to restore the appropriate database under each project when I turn on and off the new option. Is there any global parameter/setting that can help me achieve this output".

    Install the correct driver -> connect to DB -> run the script and you are ready to work.

    Remember that you can always store temporary data between tests in an external file like .json or excel file.

    • KRehman's avatar
      KRehman
      Occasional Contributor

      Hi there, 

       

      Thanks for your reply. Appreciate your detailed repsonse.

       

      I think option 1 works for me. I'll try to implement it and will get back if I have any more questions :)  

       

      Kind Regards,

      Komal