Forum Discussion

Viji123's avatar
Viji123
Occasional Contributor
8 years ago

Issue in name mapping

 

Using the object spy , I got a mapped name for an object. Say for example the mapped name looks like 

Aliases.abcd.xyz.window.Item

I ran the test cases using this mapped name it all worked fine.

Now after couple of days if I run it now it failed because the mapped name got changed . It got changed to like

Aliases.abcd.xyz.window2.Item

 

This has happened for couple of objects over a period of time. I raised this concern with my team and asked the developers if they have changed any of these objects. They confirmed that they didn't touch any of these objects.

 

Can someone help me find out the reason as to why the mapped name gets changed for some of the objects ?

 

I need to find a way to stop this , as this affects my test results

  • NisHera's avatar
    NisHera
    Valued Contributor

    I also agree with cunderw to add more...

    auto-mapping is not a good practice to develop large scale test suits. (good for beginners )

    it will create a mess up in mapping you would not be able to clean up later, remember when your suite grows name mappings also will grow.

     

    If it's a dynamic object you can use dynamic mappings techniques like using wild cards ...Link.... and extended find in mapping ..link.. 

     

    It is advisable always do mapping manually so you can carefully select and map  

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      OR... if you're going to use automapping (because it is a good shortcut to get items mapped quickly), please, please PLEASE go back and edit what was mapped.  Look for dynamic properties, close the application and re-open it to see if the objects STAY mapped, adjust properties, property values, etc., to be more robust.  And for goodness sack, clean up your Aliases... no more

       

      Aliases.Myapp.myunusedobject1.myform2.mypanel2.somegarbagecomponent_that_has_a_weird_name.buttonThatIsUsable

       

      Make it "nice"

       

      Aliases.MyApp.myActualForm.buttonThatIsUsable.

      • Viji123's avatar
        Viji123
        Occasional Contributor

        Thanks for the replies.

         

        You have mentioned about auto-mapping. I am not sure what that is. I can explain how i did mapping here.

         

        I used the object spy and select the desired object , then use "Highlight the object in object tree" option. Once am able to view the object in object browser , i right click on the object and get the mapped name (it has the alias ) .  I use this mapped name in my code. Assign a variable to the mapped name and use that vairable.

        I am doing this for mapping all the objects. I have run tests for close to 6 months using these mapped name ( variable).  95%-97% of the mapped name dont change. Its working fine. The remaining % changes for some reason which I dont know.

  • cunderw's avatar
    cunderw
    Community Hero

    While the devs may not have explicitly changed anything in code, the properties of the object are likely dynamic and there is an issue with what you're using to identify the object.

     

    As for the alias itself changing, this is probably because you have automatically map objects turned which is creating a new mapping because the dynamic property has changed.

     

    Can you provide more info about what properties you are using to identify the objects in your name mapping, and what the difference is from the first and second mapping? Without any other info any furthers attempts to debugs this would be shots in the dark.