Forum Discussion

joffre's avatar
joffre
Regular Contributor
14 years ago

Problem with MappedNames

I think I've already created a thread with something like this, but here I am again.



Here is my form's FullName:

Sys.Process("RHWCRECRUTSEL").VBObject("frmConsulta")




Here is the same form's MappedName - I mapped it manually, as Robert told me to do:

Aliases.RHWCRECRUTSEL.frmConsultaPosicoesAtivas




This form has many objects that I named manually by selecting "Display Object Properties Window" on TestComplete's toolbar.



When I open a new form to manually map it's objects names, I saw that this form's FullName and MappedName were the same as the other form, and after I recorded my script, when it starts running, it doesn't see any of this new form's objects. On "Display Object Properties Window" the only different thing between both forms is the "Caption".

The first form Caption is "Consulta - Posições Ativas" (in english: Select - Active Positions) and the the second is "Consulta - Requisições" (in english: Select - Requisitions).



How will I make TestComplete distinguish both forms?



Thanks



Obs.: I'm quoting just this 2 examples, but it happens again on 4 more forms. Our developers uses the same form for several features.
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    You need to create a new mapping item for each form.  I'm pretty sure I've been through this once before. :-)



    For the form with the caption "Consulta - Posições Ativas", create a name mapping item where one of the properties used in the mapping is the WndCaption property and have it set the value as indicated.



    Do the same for the other form.



    The problem is that you are using non-unique identifications for your form.  TestComplete matches the properties you have selected to the properties in the application.  So, if you are not using something like WndCaption or something else (like Required Children, etc), it can't tell the difference between the two forms.



    Not sure how else to explain it, really.  When you select your "Map from screen" or whatever other tool you're using, you need to add additional properties to your mapping to make this distinction.



    Can you post a screenshot of the NameMapping properties panel for the form you're working with?  See the screenshot I've attached for what I'm looking for.  
  • joffre's avatar
    joffre
    Regular Contributor
    How do I add the wndCaption to my object MappedName? I'm not understanding it.



    I've attached the screen that you asked me to. I've expanded my form's properties.
  • joffre's avatar
    joffre
    Regular Contributor
    Actually, now that I've read your post paying attention, I did it.



    It is working fine. Thanks Robert.
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Good to hear, Joffre!