Can anyone let me know if there is any substitute for a 'Static Variable' in QuickTest Pro?
A static variable is one which retains its value throughout the scripts and across functions.
I need to know if anything similar exists in QuickTest Pro, any variable whose value can be retained and used ACROSS ACTIONS.
Any alternate method to do so?
The easiest way is using Environment. Like:
Or you can use the data tables
Will I be able to manipulate the Environment variable's value across actions?
How can we manipulate/modify/update the cell values of the DataTable?
Could you please be more elaborate !!
Yes, u will be able to manipulate Env. Vars across actions.
Suppose in Action1 , u init a var."AcrossAct"
Environment("AcrossAct") = 10
(this creates a Env.var - u can check if this is created by going to Tools - Options - Environment - User Defined menu)
In Action2, if you use: Msgbox Environment("AcrossAct")
Results in "10".
Coming to DT, suppose there is a column in Action1 called "AcrossAct".
You can get/set this in Action2 by:
x = Datatable.Value("AcrossAct","Action1")
Datatable.Value("AcrossAct","Action1") = 10
This retrieves the val of "AcrossAct" across the actions.
..Mouth of a Dagger and Heart of Tofu