Forum Discussion

kashikar_harsh's avatar
kashikar_harsh
Contributor
16 years ago

NameMapping: Property values of objects getting modified at runtime


Hi


                I am
using TestComplete 7.5 to automate a dot net WinForms application. I am facing
an issue with NameMapping functionality of TestComplete. Please find below the
description of the problem


 


Problem: Name-Mapping properties of certain object gets updated
automatically at runtime by TestComplete.


 


Details: When an object is mapped, TestComplete stores some properties
of the object and their values to identify that object uniquely. We are facing
a weird issue with some of the objects which is explained below with the help
of an example.


 


Consider an object
"object1" is mapped which has property value pair as "NativeClrobject.Name
= value1" and after that if another object say "object2" is
mapped which has property value pair as " NativeClrobject.Name =
value2" (Note that same property is being used to identify both the
objects and the objects will be distinguished on the basis of the values of
this property), when we execute the script, it was observed that TestComplete always
fails to recognize either Object1 or Object2. When observed these objects in
the NameMapping, we see that the property of object1 is automatically updated
to " NativeClrobject.Name =Value2" by the TestComplete causing
failure in recognizing "object1" and hence the test cases that are
using "object1" fails saying that the object is not found.


“NativeClrobject.Name” is taken
just as an example, if we use any other property such as Name or WndCaption,
these properties also change at the runtime.


Please let me know what best can
be done in this case.


Thanks in advance.


 


Regards,


Harshad Kashikar

5 Replies




  • Hello Harshad,





    This behavior is unusual. If, during the test recording, TestComplete meets a new object with a different value of a mapping property, it creates a new mapped object for it, but doesn't overwrite the old mapped object.





    Please record a video with the following actions:

    - Open the Mapped Objects tree and select the "object1" item in it, so we can see the list of its mapping properties to the right of the tree.

    - Perform actions to reproduce the problem.

    - Open the Mapped Objects tree and select the "object1" item again, so we can see how the mapping properties have been changed.





    To record a video, you can use Jing, a free screen capture tool ( http://www.jingproject.com ).

  • Hi Alex,



    Thanks for the reply.

    Just to clarify that we are not using the Record/Playback approach and all the UI objects are mapped manually using the "Object Map" functionality of TestComplete.



    Also it would be difficult to do recording of this issue as we cannot say that mapping of which particular obejct is causing properties of other object to change (Since we have many objects and mapping of one object changes properties of any other object). If we try to see the properties of object which was not recognized at runtime, TestComplete crashes as soon as we click on that particular object. I will definitely upload the TC logs after reproducing this issue.



    By, any chance, is it possible that TestComplete is re-writting the property values of object in the NameMapping file?



    Regards,

    Harshad Kashikar

  • Hello Harshad,







    By, any chance, is it possible that TestComplete is re-writting the property values of object in the NameMapping file?







    TestComplete does not rewrite name mapping property values itself automatically. The only situation when TestComplete can change mapping criteria is when the "Automatically Update Name Mapping Items" option is enabled ( Tools | Options | Engines | Name Mapping). When this option is enabled, TestComplete prompts you to change the mapping criteria if the mapped object cannot be found. TestComplete just shows a prompt window, but does not change the criteria on its own. We are not aware of situations when TestComplete can change the mapping criteria on its own.





    We need to see the problem you are having with a real object in your project. Please pack the entire project suite folder and send it to Support. Specify the full Mapped Name of the problematic object and the mapping property whose value has been changed.





    Besides, the new 8.10 version of TestComplete has been released. It contains a bunch of improvements, including those related to handling Name Mapping issues. In particular, if TestComplete meets name mapping ambiguity, it posts a corresponding warning to the Test Log. This information can help you find out the cause of the problem, so please install the new version of TestComplete and check how it works for you.





    BTW, don't forget to send us the TestComplete crash dumps (for the situation when TestComplete crashes after clicking a Name Mapping item). Please check whether the error report files for the previous crashes exist in the Logs folder:

    "C:\Users\<username>\AppData\Local\AutomatedQA\TestComplete\8.0\Logs\" (in Windows Vista or later)

    "C:\Documents and Settings\<username>\Local Settings\Application Data\AutomatedQA\TestComplete\8.0\Logs\" (in other versions of Windows)





    If some files are there, please zip them and send us the archive.
  • Hi Alex,



    Thanks for the reply.



    I will not be able to send you the project suite, but have sent the crash dumps and screen captures to support team on the link link provided by you.



    Regards,

    Harshad Kashikar

  • Hello Harshad,





    We've received the files, thanks. Let's continue working on the problem via e-mail.