TestComplete "Losing" Methods from NameMapping
Hi
I am currently getting "Unable to find the object" errors when running a script that calls a method on a Delphi grid component. Everything is correctly NameMapped and given Aliases, and on just opening TestComplete for the first time and inspecting the grid component in the application, I see the method there in the Object Browser. But when the script is run I get the error and if I then check the object again, the method has gone.
Rather baffled, and I'm a new user to TestComplete. Any ideas greatly appreciated.
Many thanks for the help. I have now solved the problem I was having by going through the script manually, and I managed to find a line of code that appears to have caused this, although I don't fully understand why.
The script just has two routines, and in the first there was a line of code that executed a method of a completely different grid instance (same type of component, but used in a totally different part of the application). When I altered this so that it no longer called that method, my original problem was fixed. Something like this:
Sub Routine1
Call MyGrid.Method1() //Calling this appears to have altered all the grids of this type in the namemapping
End Sub
Sub Routine2
Call DifferentGrid.Method2() //This is the method that failed
End Sub
The solution I have works, but not understanding the cause is a bit frustrating, because I don't know if I'll encounter a similar issue again.
Thanks for the help, it did help me narrow this down.