Forum Discussion

shivam's avatar
shivam
Occasional Contributor
6 years ago

Facing "Ambiguous object recognition" warning for several objects

I am facing "Ambiguous recognition of tested object" warning several times on various pages and objects of my web application. I have tried to improve the mapping information for these objects by adding some additional attributes in identification properties. But it does not help. And this problem causes other issues like too much time for identifying, other times script fails! I have seen in Object browser that TestComplete identifies the HTML hierarchy as panels mostly (no matter if it is DIV,SPAN,INPUT,KENDOBOX, etc). And it will be ridiculous to add most of the parent hierarchy into NameMapping! Also, FindChild method is not working as parent itself does not have Identifiable attributes (as per Tool's OI). Does anyone know a solution to this? TIA.
  • shivam's avatar
    shivam
    6 years ago

    Hi Poornima,

     

    Try these:

    1. Increase the 'Auto wait timeout period' in project settings
    2. Improve mapping information of target object:  by adding some additional attributes in identification properties
    3. Improve mapping information of parents (of the target object): a) by by adding some additional attributes in identification properties, b) by adding a greater number of nodes in object tree hierarchy
    4. Disable the 'Show ambiguous warning' for the object 
      Note: Step 4 does not solve the problem just masks the warning in logs. And it is quite possible that your script may fail when run on remote machine or under some different environment and configuration (like screen resolution)

     

    P.S : I am still working for the concrete solution (or you can say, a satisfying workaround) to this problem.

     

    BR,

    Shivam

     

     

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    The solution is to keep doing what you have been doing.  Try to work on nailing down the property set to use for the object.  Basically, the warning means that the identification properties for your object are not specific enough and TC has found 2 or more objects that match your criteria.

    Sure, it may seem silly to include all the panels... but that might help.  And, keep in mind, you may need to MAP all the panels, but your Alias doesn't need to include them all.  That's the beauty of Aliases... it allows you to make amore "consumable" object reference while masking all the hierarchy in your main mapping.

    • shivam's avatar
      shivam
      Occasional Contributor

      Issue is not resolved but rather problem is complicated. Mapping parents and increasing the attributes for identification makes the Object Repository cumbersome (and not helpful). Tool is able to eliminate some of the warnings though by just increasing the Auto wait timeout period.

      When there are too many nodes in the hierarchy the tool is not smart enough to reach the target object. On the other hand if I cut down the parents (in order to decrease number of nodes), then there is ambiguous warning. And there are not enough ID attributes that i can take into consideration. So, at the moment, I am bypassing such objects in my project and trying to find alternate ways to test that element or feature.

      • TanyaYatskovska's avatar
        TanyaYatskovska
        SmartBear Alumni (Retired)

        Thanks for the update, shivam.

        Please share with us the approach you will decide to use.