Forum Discussion

saranoor's avatar
saranoor
Frequent Contributor
6 years ago

How to store a value that is generated in a transaction in test complete

My keyword test case is creating a work order ID in its run after doing 'n' number of steps.

I need test complete to remember or store the value from taht step and use it in next step.

How do I do this? If there is a Video please send a link.

 

28 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Variables.   IF the two steps are in the same Keyword test, then it's simply a variable in that keyword test.  If you need to store a value generated in one test to be used in another, Project level variables will work well for that.  If you use script code, you can create units that contain variables that you can then import into other units... you could even go so far as to create a Runtime Object script extension whose purpose it is to have globally available "properties" that you can assign values to use from one test step to another...

     

    Plenty of possibilities... no "one right way"... it depends a little bit on what you're comfortable doing.

    • saranoor's avatar
      saranoor
      Frequent Contributor

      Variables.   IF the two steps are in the same Keyword test,

      Yes my work order ID is being used in same keyword test. 

      I created a variable and it is a string variable with no value in it.

      But when the test is running it is not saving the value in that variable?

       

       

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        How are you assigning the value to the variable?  ARe you using the "Set Variable" operation?  What does that look like in your test?  I see the variable definition so that's fine, but you need to specifically call "Set Variable" to assign the value.