Lee_M's avatar
Lee_M
Community Hero
4 years ago
Status:
New Idea

Persistant variables type

TC has temporary variables types that can't be replicated as persistent variables

 

I need to create a Table Var as a persistent var - used for DDT loop

 

I can populate this temp var in real-time (which works) but it needs to recreated every time I want to use it,
I would like to create it at the beginning of my execution plan rather than having to recreate it every time

  • Larry_M's avatar
    Larry_M
    New Contributor

    Hello Lee_M ,

     

    Something that has worked for us is to create an event handler. Here is some documentation:
     https://support.smartbear.com/testcomplete/docs/testing-with/advanced/handling-events/about.html

     

    We use the On Start Test event handler. In the handler, if the variable does not already exist, we add it. Then we update the value stored in it. 

    if not Project.Variables.VariableExists(variableName):
      Project.Variables.AddVariable(variableName, variableDataType)
    Project.Variables.VariableByName[variableName] = variableValue

    Hope this is somewhat helpful and good luck,

    Larry

     

  • Lee_M's avatar
    Lee_M
    Community Hero

    Larry_M thanks for the idea, I like this approach.

     

    I would still like to hear SmartBear's input on this missing var type