Forum Discussion

pankhuri's avatar
pankhuri
Occasional Contributor
4 years ago

Accessing test script variables in event handlers (OnStopTestCase)

Hi,

 

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!

Pankhuri

  • 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.

     

    Emma

    • pankhuri's avatar
      pankhuri
      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.

       

      Thanks,

      Pankhuri

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi Pankhuri,

         

        You don't need variable to be persistent.

        Try temporary project variable of Object type.