Forum Discussion

jthompson1's avatar
jthompson1
Contributor
4 years ago

Anyone have some really good material for name mapping?

I'm wondering if someone can relate and has gone through what im about to explain but they found a really good write up that educated them about name mapping. I've already gone over the material provided by default from testcomplete (object tree model...breadth vs depth, naming aliases etc... ) and I still struggle with name mapping. It's frustrating because I am spending more time trying to make the **bleep** software recognize objects on the webpage more than anything. I'll record and do playback and it just loses it's **bleep** mind saying it cannot find the object, and i'm sometimes spending a whole day on one test case trying to find some compromise where I can complete the test automation because testcomplete cannot recognize objects it previously added to name mapping. It's very frustrating and I just wish I could use the software the way it's advertised. I sometimes just ignore the built in name mapping all together and resort to using XPath and Jscript to find objects on a screen... which feels more like a compromise because I'd much rather use the built in testcomplete name mapping to make life easier.  

  • The name mapping guides are in itself quite useful as they show you how to do things like add items, maintain items.

     

    I see you mentioning using xpath solves your issue, You know you can use xpath selectors in the name mapping? 

     

    To do this enable xpath and css for web objects. 

     

    In an existing project 

     

    Click on tools On the Open Applications > Web Testing > General page of the existing project’s Properties page.

     

    Or open a new project all together and enable it. 

     

    Going forward as you record new items, in the the namemapping it will reference the same alias but instead of using object properties it will use xpath and css selectors 

     

    You can remove or add in what ever selectors you want, and as many as you want. 

     

    That way testcomplete will try to find what ever selectors you reference in the name mapping in the order you list them. 

    This is a useful alternative method for web apps. 

     

    This also allows you to scale your web tests using Smartbears Device Cloud, (simply using that web test against a local browser,  connects to the device cloud CBT with thousands of real browser configurations on multiple platforms like IOS,Android, MAC and Windows and run them on those configuration) 

    See 

    https://support.smartbear.com/testcomplete/docs/app-testing/web/cross-platform/index.html

     

    If you dont want to use Device cloud you can still enable that mode for scaling down the line in the future or even leveraging using Xpath and Css selectors  

    See On the https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/xpath-expressions-and-css-selectors.html

     

     

  • The name mapping guides are in itself quite useful as they show you how to do things like add items, maintain items.

     

    I see you mentioning using xpath solves your issue, You know you can use xpath selectors in the name mapping? 

     

    To do this enable xpath and css for web objects. 

     

    In an existing project 

     

    Click on tools On the Open Applications > Web Testing > General page of the existing project’s Properties page.

     

    Or open a new project all together and enable it. 

     

    Going forward as you record new items, in the the namemapping it will reference the same alias but instead of using object properties it will use xpath and css selectors 

     

    You can remove or add in what ever selectors you want, and as many as you want. 

     

    That way testcomplete will try to find what ever selectors you reference in the name mapping in the order you list them. 

    This is a useful alternative method for web apps. 

     

    This also allows you to scale your web tests using Smartbears Device Cloud, (simply using that web test against a local browser,  connects to the device cloud CBT with thousands of real browser configurations on multiple platforms like IOS,Android, MAC and Windows and run them on those configuration) 

    See 

    https://support.smartbear.com/testcomplete/docs/app-testing/web/cross-platform/index.html

     

    If you dont want to use Device cloud you can still enable that mode for scaling down the line in the future or even leveraging using Xpath and Css selectors  

    See On the https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/xpath-expressions-and-css-selectors.html

     

     

    • jthompson1's avatar
      jthompson1
      Contributor

      is it risky to change to xpath and css with existing project? There are some elements that actually do work with my current name mapping. 

      • vinniew's avatar
        vinniew
        Staff

        I wouldnt say its risky. the old mapping will still exist.

        and it can be turned on and off(Switched), and as long as the old criteria works and is in the name map then thats ok. 

        Essentially by enabling your telling TC what to reference in the namemap as you record. So only going forward and creating new tests are you using Xpath nd CSS in the name map.

         

        As for maintaining both in a single project, it is doable but I can also see how testers may prefer just the one approach per project.

        perhaps open a separate project and see how it works for you and this app under test.

        It might help your decision to determine how best to move forward