Forum Discussion
rgratis
13 years agoFrequent Contributor
Not certain how you have written your script extension, but could it be that your MGMainAliases runtime object is storing an out-of-date copy of the Aliases.MGDIS_LanceurNET object? When objects in the tree are created and destroyed, TestComplete's Aliases automatically refreshes and resets all its pointers to the new objects, but if you have stored a copy in a variable, this variable does not get automatically refreshed. It still points to the original object, which no longer exists.
To get around this, I have a little "checkObjects" function in my script extensions that does something like "if storedObject.Exists = False then storedObject = Aliases.<whatever>" and basically reassigns the variable. I then call "checkObjects" before trying to do anything within the script extension to make certain I'm not working with a dead copy.
To get around this, I have a little "checkObjects" function in my script extensions that does something like "if storedObject.Exists = False then storedObject = Aliases.<whatever>" and basically reassigns the variable. I then call "checkObjects" before trying to do anything within the script extension to make certain I'm not working with a dead copy.