Forum Discussion

pankhuri's avatar
Occasional Contributor
4 years ago

Accessing test script variables in event handlers (OnStopTestCase)



I am writing a onStopTestCase event handler (script version) and trying to access variables defined in my test script. Unfortunately, i am not able to get the recent /latest values of those variables in event handler. I have defined these variables as global in my test script. Note- these are not project level variables.


Can anyone help me with this?


Thanks in advance!


3 Replies

  • Hi pankhuri - 


    If the variables are not project level variables then they will only be available in the test where they are generated. Have you tried creating persistent variables at the Project level? I believe this is what you will need to do.



    • pankhuri's avatar
      Occasional Contributor

      Hi Emma,


      Thanks for replying back. I was going to try the global persistent variables but i noticed there is no option to create a variable of type list. Is there any other way i can create a global variable of type list.




      • AlexKaras's avatar
        Champion Level 3

        Hi Pankhuri,


        You don't need variable to be persistent.

        Try temporary project variable of Object type.