Forum Discussion

lucieneven's avatar
lucieneven
Contributor
14 years ago

where to rename the objects to trouble-shooting anbiguous recognition issue

Hello,



This is a generic question about handling "
ambiguous recognition of application objects."



We recorded the script and then play back, noticed this ambiguous recognition issue at the line of following script:





call table.cell1.linkTheformTabledatabases1JIdt57.textnodeTheformTabledatabases1JI.Click(24, 7)




The exception is like below:

"There are several objects in the system that match the recognition attributes of the "table" mapped object.


This may cause the "Object not found" error.


Objects




Sys.Process("IEXPLORE").Page("http://192.168.0.218:8080/jmapadmin/index.jsp").Frame("center").Form("theForm").Panel("element_box").Panel(1).Table("theForm_dataPaginator")


Sys.Process("IEXPLORE").Page("http://192.168.0.218:8080/jmapadmin/index.jsp").Frame("center").Form("theForm").Panel("element_box").Panel(1).Table("theForm_tableDatabases")




To solve the problem, you may need to modify mapping settings for the "table" object or one of its parent objects."



To trouble-shooting, we switch and back between Object Browser and NameMapping. To our knowledge, the TestComplete wants to find the "table" object, but as can be seen from Object Browser, it finds two Table, one is dataPaginagor, other is tableDatabases, both of them refers to the same MappedName. That might explains why TestComplete can't distinguish which is which. Please correct me if i'm wrong here, :)



If it is so, the problem is what we can do in this case. We go through the help manual:

"Resolving the Problem




As we have said above, the warning message indicates that there are
several objects in your tested application that meet the specified
condition.


So, to resolve the problem we recommend that you specify a mapping condition
that will be met only by one object in the application. If it is impossible, try
to rename the objects in your application so that only one of them meets the
specified condition."


Here i'm just wondering exactly which objects in the application should be renamed and where we can do this. In the NameMapping as enclosed NameMapping2.pgn?


We don't have any experience on anbiguous recognition, but seems it's very important skill. Please shed some light here, great thanks!


Lucien

1 Reply

  • Hi Lucien,

    To our knowledge, the TestComplete wants to find the "table" object, but as can be seen from Object Browser, it finds two Table, one is dataPaginagor, other is tableDatabases, both of them refers to the same MappedName. That might explains why TestComplete can't distinguish which is which. Please correct me if i'm wrong here, :)


    Yes. This is exactly the case of ambiguous recognition - there are several objects that match the mapping criteria, and TestComplete cannot automatically choose which one of them to use. To resolve the issue, we need to adjust the mapping criteria so that they would provide unique identification of the object.

    In most cases, we just need to add some more properties to be used for object recognition. To determine which of the properties can serve for this purpose, we need to compare the ambiguous objects in the Object Browser, compare their property values and pinpoint dissimilar values. For instance, in your case, the "touchstone" properties are idStr or ObjectIdentifier, since their values allow TestComplete to determine whether it deals with dataPaginator or tableDatabases. Once the "touchstone" property is determined, we can add it to the mapping criteria via the Edit Name Mapping Item Dialog.



    Thus, in most cases, there is no need to "rename" any objects.  



    Regards.