| || |
- 1 Post By bklabel1
how classes executing in QTP
In my framework, the existing person written one sub for killing the excel and placed that code inside the class, and he just instantiate that class.
It's look like below,
Private Sub Class_Terminate
"code here to kill"
Set Start_Script=New Setup_Script
so,while executing the script this "Set Start_Script=New Setup_Script " line is the first line in that action, and above class also inside the same action,after entire execution completed,it's automatically killing the excel,
but how this class is executing,i am bit confusing.
how it is calling without using the method name like "Start_Script.Class_Terminate "?
How it is executed exactly before whenever the qtp stops?
can anyone please clear my doubts.
Thanks & Regards,
QTP has a Class_Initialize and Class_Terminate built into QTP. When the class is enstantiated or destroyed, it automatically runs these methods.
When your script reaches the end it releases/terminates the class. At that time, the Class_Terminate() is activated and does the "coee here to kill".
By the way classes that we make can also have these two methods.