A question about manual object mapping
Hello,
Short question : when I map an object (in this example the notepad window), TC suggests several criteria to identify it.
As I understood, the goal is to identify properties that could make a sort of "primary key".
So for this object :
Sys.Process('notepad').Window('Notepad', 'Sans titre - Bloc-notes', 1)
TC proposes two criteria :
WndClass : "Notepad"
WndCaption : "Untitled - Note Pad"
Why not using simply "Sys.Process('notepad').Window('Notepad', 'Sans titre - Bloc-notes', 1)" as unique criteria ?
Thank you,
Mehdi
Hi Mehdi,
Sys.Process('notepad').Window('Notepad', 'Sans titre - Bloc-notes', 1) is the path to the object in the object tree. Right now, you are choosing properties for only the window. So, WndClass is a unique property that will identify the control type and WndCaption will identify an object with the target caption.
I don't recommend that you use Window('Notepad', 'Sans titre - Bloc-notes', 1) mostly because of the Index property. During the next run, or when several Notepad windows are run, the index may be different. Thus, TestComplete won't find the object.
Anyway, you can always change the mapping properties and use the properties you want or you know the ones that will identify your control for sure.