Forum Discussion

Kenny_Mooney's avatar
Kenny_Mooney
Occasional Contributor
10 years ago

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 ju...
  • Kenny_Mooney's avatar
    Kenny_Mooney
    10 years ago

    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.