Forum Discussion

dhundley's avatar
dhundley
Regular Contributor
9 months ago

Persistent Variable Values not persisting in CI/CD environment

I created a Persistent empty string variable at the project suite level. I created a function that gets called in the OnStartTestCase event handler that puts a string value into the variable and then echoes that value into the results log with a Log.Message statement. When i used the Network Suite to do a remote run on one of my VM's the string value appeared in the log as desired. But, after committing my changes and running my automation in an azure pipeline only a blank value appears in the log. 

I have no default value for this variable. it needs to be obtained and set by my local workstation each time at the start of the project and then be displayed in the log no matter where it runs. if a project suite persistent variable won't do that, what will?

  • I don't seem to get notified on new posts on this new system, otherwise I would have responded. 

    Persistent and Temp variables are only applicable to TestComplete IDE. You can use Storages.INI Method, and if you are using scripts, on the first line call the ini to read and set the variable(s)

  • dhundley's avatar
    dhundley
    Regular Contributor

    in the absence of a solution or even a suggestion, i have opted to use an external file that is accessible both to my workstation and to the azure pipeline. I'd still like to know why the local value of a so-called "persistent" variable was not there for my pipeline if anyone cares to weigh in on that. is there, by chance, anyway to programmatically "set" the default value? thanks!

    • rraghvani's avatar
      rraghvani
      Champion Level 3

      I don't seem to get notified on new posts on this new system, otherwise I would have responded. 

      Persistent and Temp variables are only applicable to TestComplete IDE. You can use Storages.INI Method, and if you are using scripts, on the first line call the ini to read and set the variable(s)

      • dhundley's avatar
        dhundley
        Regular Contributor

        i have incorporated the Storages.INI in my project. It is about ready to run for the first time. I'll reply back if it fails to work but I'm pretty confident it will