Forum Discussion

BrianSmart's avatar
BrianSmart
Occasional Contributor
4 years ago

Recording tests creates duplicate browser mapping

When I go to record a script test, the browser that I'm using is mapped again, and then it proceeds to map all of the objects that I have already mapped. Running my tests uses the first mapping of my browser perfectly, I don't know why it's doing this, but it's ruining my name mapping.

  • ebarbera's avatar
    ebarbera
    4 years ago

    Hi BrianSmart - 

     

    I would recommend removing the full name property from the original browser mapping. The full name property makes the objects specific to edge which is probably what is causing the tool to repeat the mapping. It is better to have a generic mapping just using ObjectType browser like the second mapping shows.  

     

    Let me know if you have questions. 


    Emma

  • Is this happening on different machines or on different browsers?  Let's see a screenshot of your name mapping with some of the duplicates.

    • BrianSmart's avatar
      BrianSmart
      Occasional Contributor

      This is happening on the same machine using the same browser each time (MS Edge)

       

      Here's the original mapped browser

      Here's the duplicate created when recording tests:ā€ƒ

      Here's the properties of the original mapped browser:

      Here's the properties for the duplicate mapped browser:

      ā€ƒ

      ā€ƒ

      • ebarbera's avatar
        ebarbera
        Staff

        Hi BrianSmart - 

         

        I would recommend removing the full name property from the original browser mapping. The full name property makes the objects specific to edge which is probably what is causing the tool to repeat the mapping. It is better to have a generic mapping just using ObjectType browser like the second mapping shows.  

         

        Let me know if you have questions. 


        Emma

  • jr348's avatar
    jr348
    Contributor

    Look at the point where they split from a common parent then use wildcards and/or remove some of the properties that might be different when the page opens next time. 

     

    Many web frameworks such as REACT use one-off class names for example:

     

    Username_TextBox_21837_hgggh33ezr4

     

    This would be mapped as Username_TextBox_*