Forum Discussion

william_roe's avatar
william_roe
Super Contributor
10 years ago

If I had it all to do over again

If I had it all to do over again I would seriously consider disabling the 'Map object names automatically' before recording automated UI tests. Our developers do a reasonably good job naming objects so the recorded tests are easy enough to read. Occasionally there are hierarchy changes which throw us for a loop and we seem to constantly be chasing name mapping issues and wonder had we turned this setting off would if we would be having so many issues. I've been writing a fare bit of script lately which references the alias and it does not seem as fragile as the recorded tests which automatically create name mapping. If we were to turn this setting off would the recording use the alias and stop created name mappings for each object used in a test? Would this possible make our tests less fraile and easier to maintain? It seems TC should be better able to keep the object map and name map in sync but when I tried moving object up a level in the object map the object could no longer be found because the existing tests use the mapped name.

 

I'm hoping to open up a discussion which will help us all. I don't profess to be an expert with TC. We've been using TC for about eight months now and probably have somewhere in the neighborhood of 2,000 individual steps across numerous tests. The ability to maintain tests is becoming more of problem each week and have nearly abandoned the ship on numerous occasions. 

 

Let's get this discussion going.

21 Replies

  • I'll second Marsha's approach. We manually map everything we need up front, then write the test.There are instances where I've had to do .Find for an object I actually have mapped because waitaliaschild doesn't seem to be very consistent. But overall, using the namemapping has been very beneficial. But I don't let TC automatically map/name anything.

    • william_roe's avatar
      william_roe
      Super Contributor

      jmcpeek wrote:

      I'll second Marsha's approach. We manually map everything we need up front, then write the test.There are instances where I've had to do .Find for an object I actually have mapped because waitaliaschild doesn't seem to be very consistent. But overall, using the namemapping has been very beneficial. But I don't let TC automatically map/name anything.


      Good feedback - thank you. Do you know if by not naming the alias is used?

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        I created a new project with no name mapping at all and then recorded a test over our app.  Looks like it just takes the object name.

         

        clickingaround.png

         

        What you need FindChild for is when all your fields are "EmbeddableTextBoxWithUIPermissions" (or some other thing where they all look alike on the click level) and you need to use another property to distinguish them.  

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi William,

     

    Thanks for bringing up this question. Our R&D team are currently collecting feedback about possible issues/misunderstanding related to Name Mapping. That would be great to hear what problematic situations you face and how you usually resolve them. Please share your thoughts.

     

    As for the changes in hierarchy, did you try using Name Mapping’s Extended Find feature?

    • william_roe's avatar
      william_roe
      Super Contributor

      TanyaYatskovska wrote:

      Hi William,

       

      Thanks for bringing up this question. Our R&D team are currently collecting feedback about possible issues/misunderstanding related to Name Mapping. That would be great to hear what problematic situations you face and how you usually resolve them. Please share your thoughts.

       

      As for the changes in hierarchy, did you try using Name Mapping’s Extended Find feature?


      When there was a hierarchy removed from the mapping we opened the name mapping file in notepad++ and manually (carefully) removed the level. We then opened all the keyword tests at once in Notepad++ and did a find/replace across all keyword test and removed level. Otherwise the tests would no longer be able to find the objects (I seems to me that moving the objects in the object mapping in TC would change the name mapping but it did not and we had to take matters into our own hands). However, there were still  many places we had to re-map in TC (I suspect the developer made additional changes which we weren't informed). My suspicion is that had we not name mapped this objects there would have been one less step and less manual re-mapping in TC.

       

      We have extended mapping turned on and see the warnings in the log whenever a test fails.

       

      With regard to better describing / explaining name mappings, my current question are; If we turn off auto 'map names automatically' will this stop the automatic creation of named mapping and if we don't manually create a name mapping will the keyword tests refer to the alias? Are there benefits / drawback to this? We were initially drawn to name mapping as a "friendly name" but it seems there are more drawbacks than benefits because TC doesn't appear to sync object mapping changes with the name mapping.

       

      It's quite possible some of my assumptions are incorrect but I write this from my understanding of the product.

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        We hardly ever use the automatic mapping.  It takes some time at the beginning of a project to map the new parts, but we are able to rename objects to our standard so that they are more easily read in a test.  Occasionally we use the automatic mapping on an individual object if we've missed one, but it's been worth the time investment to do most of it manually.