I assume it is not because of the space you have here ( i have highlighted with _ )
and the reason would be...
Actually when the library files you have added in the resources are loaded, it would be available for all the actions. It is global scope.
Once Recovery scenarios and library files are loaded, when QTP enters the action, it creates only local scope for everything.
So in Action2, 'new check' is what creates an instance of the class and assigns a reference. When you try to call this in Action1, obviously it will not be available for Action1.
It happens as it is an object. If you assign a value, it will work because it is a value not a reference.
So you can not access methods or properties of the class
In order to make this work,
'Set checkObj = new check' should be in a external library file.
So that it can create an object in global scope. But in order to put this statement, you also need to keep the class as well in the external file where you have 'Set checkObj = new check'.
But if you do so, i bet you do not need to have any globaldictionary because the 'checkObj' itself will be available globally!!
This is my best guess. Others, Please correct if i am wrong.
Code:
Set checkObj = new check
GlobalDictionary.Add "checkObj_", checkObj
and the reason would be...
Actually when the library files you have added in the resources are loaded, it would be available for all the actions. It is global scope.
Once Recovery scenarios and library files are loaded, when QTP enters the action, it creates only local scope for everything.
So in Action2, 'new check' is what creates an instance of the class and assigns a reference. When you try to call this in Action1, obviously it will not be available for Action1.
It happens as it is an object. If you assign a value, it will work because it is a value not a reference.
So you can not access methods or properties of the class
In order to make this work,
'Set checkObj = new check' should be in a external library file.
So that it can create an object in global scope. But in order to put this statement, you also need to keep the class as well in the external file where you have 'Set checkObj = new check'.
But if you do so, i bet you do not need to have any globaldictionary because the 'checkObj' itself will be available globally!!
This is my best guess. Others, Please correct if i am wrong.