Ask a Question

In TestComplete - How do I clear all the global variables before re-running the script

SOLVED
nedbacan
Frequent Contributor

In TestComplete - How do I clear all the global variables before re-running the script

How do I clear all the global variables in the project before re-running the script again. 

 

Thank you.

4 REPLIES 4
Marsha_R
Community Hero

You would have to reset each one of them individually.  Another option would be to add them all at the top of your test and delete them all at the end.

 

https://support.smartbear.com/testcomplete/docs/testing-with/variables/collections/project-and-proje...


Marsha_R
[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
AlexKaras
Community Hero

Hi,

 

Are you talking about global variables of your scripting language or about Project Variables?

In case of latter, just create them as Temporary (not Persistent) ones if you are not interested in preserving their values between test runs.

 

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
================================
nedbacan
Frequent Contributor

I am referring to Project Variables but when I want to repeat test again, I would like to clear all global variable to my project so at the end is all new data.  I understand the previous data are overwritten, but to assure myself I prefer clearing everything all at once.  Is there a way to do this in javascript?

These variables are pass down to other scripts within the project.

There are javascript examples for adding and deleting variables at the link I mentioned earlier.

https://support.smartbear.com/testcomplete/docs/testing-with/variables/collections/project-and-proje...

 

 


Marsha_R
[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
cancel
Showing results for 
Search instead for 
Did you mean: