Forum Discussion

jgibbs343's avatar
jgibbs343
Occasional Contributor
25 days ago

Name Mapping not Working in Latest Version

I am encountering a problem with name mapping in TestComplete where my script cannot find my mapped object. The mapped object is definitely visible, and if i go into the name mapping section of TestComplete and press "Highlight" test complete can see that it is on the screen and highlights it. It specifically cannot see the mapped object when the script is being run.

This name mapping worked in an older version(15.61), however in the newest version of test complete(15.76). I am not sure exactly between which versions it stops working. When I initially ran into this issue, most people suggested just rolling back to the previous version, and 15.61 was the only installer i had that i knew would work. I am trying to solve this without rolling back versions because i would like to use python 3.11.

Thank you, any help is appreciated.

23 Replies

  • chkwto's avatar
    chkwto
    Occasional Contributor

    I have encountered the same issue. When I call a function multiple time with namemapping in it the first time it works. The seconds time it doesn't

    • jgibbs343's avatar
      jgibbs343
      Occasional Contributor

      i found that essentially having a while loop that waits for your object to exist, helps. its like initially TestComplete doesnt see the object, but if you tell it to wait for it, it will find it.

  • scot1967's avatar
    scot1967
    Icon for Champion Level 2 rankChampion Level 2

    I am don't know if has been mentioned here (I haven't read every post) but is the 'Self Healing' feature enabled?  Sometimes this is a blessing and other times a curse.  It depends on how well structured your application object tree is.  It should show up in your logs if this feature is changing your mappings so I doubt this is the case.

    ... If you find my posts helpful drop me a like! ๐Ÿ‘ Be sure to mark or post the solution to help others out and/or to credit the one who helped you. ๐Ÿ˜Ž

    • rraghvani's avatar
      rraghvani
      Icon for Champion Level 3 rankChampion Level 3

      As mentioned by jgibbs343โ€‹, "issue may be caused by the fact that the software is not already open prior to running the test" - that's the issue!

      • chkwto's avatar
        chkwto
        Occasional Contributor

        I don't use any self healing feature. We disable all the QA and AI feature.

        rraghvaniโ€‹  What do you mean with -->  "issue may be caused by the fact that the software is not already open prior to running the test" - that's the issue!

        Can you clarify it ?

  • jgibbs343's avatar
    jgibbs343
    Occasional Contributor

    For any who are reading this, I have a newer update. I have found that 15.71 to 15.72 update is when my name mapping broke. After further investigation I found that in upgrading the version caused my mapped object to identify as other Mapped Objects. I have submitted a support ticket about this, and will update again once i have more information. For the time being i have rolled back to 15.71

    • chkwto's avatar
      chkwto
      Occasional Contributor

      I've got a reply from SmartBear Customer Care. They told me to use a workaround with the full object name. I replied to them that is not an acceptable solution. If it works before with a previous version it should work with the latest version.

  • rraghvani's avatar
    rraghvani
    Icon for Champion Level 3 rankChampion Level 3

    You need to provide more content - are you testing against a Browser or Desktop application? If TestComplete can identify and highlight the UI object, then when you run your script what is changing? Are you using Classic of XPath?

    • jgibbs343's avatar
      jgibbs343
      Occasional Contributor

      I am testing against a Desktop application. When i run the the script nothing is changing. To the point that if i leave the application on the screen where TestComplete tells me it cant find it, and press highlight in name mapping, it highlights it.

      I am using classic name mapping.

      • rraghvani's avatar
        rraghvani
        Icon for Champion Level 3 rankChampion Level 3

        Are you able to create a new project, create a name mapping for the object, and perform the required action on the object?

        What is the FullName property value of your object?

  • jgibbs343's avatar
    jgibbs343
    Occasional Contributor

    ( Replied in the wrong place, and cant delete comments )

    • rraghvani's avatar
      rraghvani
      Icon for Champion Level 3 rankChampion Level 3

      If the FullName is Sys.Process("Phoenix").Window("Phoenix", "Phoenix", 1).Window("MDIClient", "", 1).Window("AfxFrameOrView140su", "Phoenix", 1).Window("AfxFrameOrView140su", "", 1).Window("#32770", "", 10) then

      Ensure the child object .Window("#32770", "", 10) value does not change.

      Also ensure the parent objects .Window("AfxFrameOrView140su", "", 1) values does not change, including it's parent objects.

      In your new project, run your automation script, if it stops because it's not able to find the name mapping. Then use the Object Spy tool to identify your UI object - do not close your application.

       

      • jgibbs343's avatar
        jgibbs343
        Occasional Contributor

        So, in doing this I've noticed that the issue may be caused by the fact that the software is not already open prior to running the test, as I Open and close the software for every test. So I need to look into what about opening the software changes.

        For reference, if I run the test and it fails, and i then run it again with the same instance, it works fine, so all of the elements of the name mapped item are the same every time i open the software, so I'm still not sure why this is happening, but i will be trying to get to the bottom of it.

  • JAvila1234's avatar
    JAvila1234
    New Contributor

    NameMapping is failing for me for Keyword Tests copied from one Project to another Project within the SAME Project Suite - yes, I used the "Add Existing Item" method to copy the test...

    I see unresolved NameMapping issues going back over 5 years in this forum... 

    I understand how NameMapping might help handle system transitions - but, like most things in life, I find not calling things by their 'true' name causes more problems than it resolves...

    My SOLUTION is to NOT use NameMapping - most simple editors can help make find/replace names in your code when needed  :)

    • Hassan_Ballan's avatar
      Hassan_Ballan
      Icon for Champion Level 3 rankChampion Level 3

      I understand you have an existing script that runs perfectly in project A, and in project B you used "Add Existing Item" to add project A script; however, this script fails to run under project B as it is not finding the NameMapping references.

      If I correctly understood your scenario, you are missing an important fact that each project also contains it's own NameMapping database that is not shared with other projects in the suite.

      You could design you projects to share scripts as well as the required NameMapping https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/how-to/merge.html and that requires careful consideration and planning in addition to deep understanding of NameMapping https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/index.html 

      ๐Ÿ’ฌ Found the answer helpful? Give it a Kudos by clicking Like!
      โœ… Got your issue resolved? Click Mark as Solution so others can find it quickly.

      • JAvila1234's avatar
        JAvila1234
        New Contributor

        Dear Hassan, thanks for sharing this info - this is not my question thread (just lurking since I have same issue), so I leave J.Gibbs to decide if this resolves....

        Reading info you shared, seems the nameMapping needs to be performed again and again, after new nameMappings are added or changed :(     Also what about mapping of three (or four or five..) NameMappings?  is that even possible?  Is there a limit?

        All considered I still don't see NameMapping value-added for my current project, and have disabled it.  Thanks for sharing info all the same, perhaps may help a future project :)

    • jgibbs343's avatar
      jgibbs343
      Occasional Contributor

      I've looked through a lot of those as well. The strange thing for this instance, is that it is the same Project, nothing changed, except for my TestComplete version, and suddenly the name mapping is failing. My team has spent a decent amount of time mapping all of the screens and buttons in our software, so I'd like that work to be of use to us.