Problem seach object
I have two object. This objects have name equal, but In the NameMapping these objects have differents names. The names of object are dinamics.
Example: When I open the windows name is: "PadraoJanelaDinamica", if open the windows again the name changes for "PadraoJanelaDinamica1". This happens in both windows. The ClassName of objects are differents: "TJanelaGerarCodigoBarras" and "TPadraoJanelaDinamica". What happen is I open "PadraoJanelaDinamica" the TestComplete not know what I'm opening.
How do I solve this?
Thank You
Instead of using the object name directly, go up the mapping tree and find where the two objects are different, then use that object with FindChild to get to the name you want.
https://support.smartbear.com/viewarticle/80676/
If the name is changing each time, you may need to map it with a wildcard.
https://support.smartbear.com/screencasts/testcomplete/wildcard-dynamic-property-in-testcomplete/
Thank you Marcha.
The problem was solved with FindChield.
procedure producao_por_item_acabado; var vezes; begin for vezes := 1 to 4 do if not (Aliases.control.FindChild('ClassName', 'TPadraoJanelaDinamica').Exists) then begin Aliases.control.Principal.Keys('~m'); Aliases.control.Principal.PopupMenu.Click('[7]'); Aliases.control.Principal.PopupMenu.Click('[3]'); Log.Message('Essa é a ' + IntToStr(vezes) + 'ª tentativa de acesso ao menu.') end else end;