cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing test script variables in event handlers (OnStopTestCase)

pankhuri
Occasional Contributor

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

3 REPLIES 3
ebarbera
Staff

Re: Accessing test script variables in event handlers (OnStopTestCase)

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

Tags (1)
pankhuri
Occasional Contributor

Re: Accessing test script variables in event handlers (OnStopTestCase)

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.

pankhuri_0-1620756329879.png

 

Thanks,

Pankhuri

AlexKaras
Community Hero

Re: Accessing test script variables in event handlers (OnStopTestCase)

Hi Pankhuri,

 

You don't need variable to be persistent.

Try temporary project variable of Object type.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors