Forum Discussion

JPD's avatar
JPD
Occasional Contributor
5 years ago

NameMapping - Adding recorded names to my manually mapped objects

Hello, 

 

I am testing a large Desktop Application and wish to utilise other members of the team at least in the NameMapping process. 

 

I have already started to Map names manually, selecting properties to map and giving them suitable names, but in order to speed things up I was hoping to use the recorded name mapping to at least manually map a lot of the objects which I would then edit to use more suitable properties and names. 

 

However, everytime I attempt to map some new names with a recorded test rather than recognising I have already mapped some of the existing objects, or even the tested application, and then not adding any items until it finds an unmapped object it is just creating a whole new object tree under the existing one. 

E.G, 
Manual Maps App > Shell > Grid > Pnl > btn 

If I was to naviagate to the same place in a recorded tests I would see:

App > Shell > Grid > Pnl > New Btn 

Under the existing tree. 

Instead of: 
Manual Maps App > Shell > Grid > Pnl > Btn - New Btn 

Is this an issue with my configuration or is what I am hoping for not a feature currently? 

  • I appear to have solved it. 

    I remapped my App to match exactly what is mapped by the recorded scripts. Ensured that in Tools > Options I was set to update namemapping whilst recording and then recorded a new test. 

     

    (Although as previously mentioned I had tried to rename the mapping properties before). 

     

    I am going to accept this as the solution. 

    Thank you all for trying to help me troubleshoot. 

     

    Solution = Remove conditional mapping on App. Remap App properties to match exactly what the duplicate object was using when mapped during a recorded test. Ensure option to update when mapping was on. 

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    If you've already mapped something in a project, when you record, it should use the existing mapping if, during the recording process, it finds the same object.

     

    What your results tell me is that, when you're recording, it's not always finding the same object meaning something you're using in your properties is dynamic enough that, each time you run your application, the value changes.

     

    If you could post screenshots of your namemapping with images of the properties for the objects you're having trouble with, that would be helpful.

    • JPD's avatar
      JPD
      Occasional Contributor

      Hello, 

       

      Thanks for a quick response. 

       

      I think I am generic enough to not be falling foul of any dynamic property changes whilst being specific enough to ensure the correct objects are being found. 

       

      The app is being located with conditional - Name/FullName/ProcessName - where they can vary based on the environment we are testing on. E.G, name = Process("AppReleaseCandidate") or name = Process("AppTest")

       

      From then on it is mostly ClrFullClassName or ClrClassName, or if I can be sure that the Name is static enough then using that as well. 

       

      All the existing items have been added manually to NameMapping from the object tree view. 

       

      Recording new tests will add a duplicate NameMap for everything, from the App -> Shell > LayoutRoot > Presenter. Each of which do not change dynamically. 

      I have attached the current map down to The Main Content Control item.  

      • JPD's avatar
        JPD
        Occasional Contributor

        And in addition here is an example of a 2nd tree being added by the automapping features