Forum Discussion
Hi Kavan,
Not sure if I correctly understood the problem, but:
> 'Declare Public objects
> Set objTradeTicket = Aliases.wndTradeDetails
This is not declaration, but initialization (assigning a reference to the object that must exist at the moment of assignment).
To declare the variable, use just
Dim objTradeTicket
When you are assigning a reference to some object, e.g.
Set Yes_Btn = Aliases.javaw.heavyweightdialog1ConfirmClose.scene.buttonbar.buttonYes
all objects mentioned in the assignment (i.e. javaw and heavyweightdialog1ConfirmClose and scene and buttonbar and buttonYes) must exist. Otherwise TestComplete will post the error to the test log that this or that object was not found. This is expected and correct behaviour.
Use the .Exists property to check if the given object exists at the given moment of time.