Forum Discussion

Luukdb's avatar
Luukdb
Contributor
3 years ago

All project variables are gone

Hello,

 

I just opened my project file and noticed all my project variables are gone. I tried to restore an older version of our project, but this also didn't work.

Currently I am adding the variables manually. But I am wondering if more people experienced this and how to fix this instead of adding all the variables manually.

 

Kind regards,

Luuk

7 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Project variables are stored in the project .mds file. So it had to be something done over this file (incorrect source control merge etc.) that removed section with project variables from it.

     

  • Mr_Bro's avatar
    Mr_Bro
    Frequent Contributor

    HI Luukdb 

     

    can you make use of adding the variables in your script : 

    Project.Variables.AddVariable("MyExportFilePath", "String");

     

    please refer this document for your further reference.

    • Luukdb's avatar
      Luukdb
      Contributor

      Mr_Bro This is a good idea, I am going to give this a try when it happens again

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        I would contact Support directly about this.  Here's the link:

        https://support.smartbear.com/testcomplete/message

         

        fyi, to use Mr_Bro idea, you would need to do it now, in order to ward off the problem in the future.  What that code does is look for the variable in question and if it does not already exist, it adds it at that time.

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    What version of TestComplete are you running?  I saw that happen years ago but I haven't seen it lately.