Forum Discussion

nakshatra's avatar
nakshatra
Contributor
5 years ago
Solved

unable to highlight the selected object on screen

Hi,

 

I am trying to record one test case. After recording if I play back test case is getting failed. 

Property chek points and some clicks functions are getting  failed. I tries to hightlight perticular property on screen then it is showing "Unable to highlight the selected object on screen".

I am facing this problem frequntly. If i try to run one week old recorded test cases also same problem i am facing.

If I run all smoke test cases, half of the test cases are getting failed because of this error(Object doesn't exist).

But the object is present in Name mapping editor.

 

Could please anyone help me do I need to take any precautions to avoid this problem?

Kindly tell me the possible reason for this error.

 

Thanks in advance.

 

  • nakshatra's avatar
    nakshatra
    5 years ago

    Thanks for the reply and suggestions.

     

    Your suggestions worked for me littile bit. Now I am mapping objects manually and we ask the developers to provide unique attributes.

     

    by these two some what problem got solved. 

9 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    The reason is simply this:

    Recording a test is a good STARTING point.  Once the test is recorded, there are at LEAST two things you need to do, and they are not necessarily simple.

     

    1) Examine/evaluate what was mapped during the recording.  Many times, objects have identifying properties that are dynamic and change from execution to execution and you will need to make modifications, updates, even completely remap objects and their hierarchy in order to more reliably identify the object.  

    2) Examine/evaluate the execution of the test case recorded with an eye towards timing issues.  Many times TestComplete will attempt to move forward to the next step/line of code before the application is ready to be interacted against.  Pages need to load, client-side components need to resolve/render, behind-the-scenes data needs to compile, etc.  Liberal use of "wait" methods (do a search in the help for "waiting for objects") will help resolve this.

    There may be more, but this is the starting point. Basically, record/playback for test automation in this day and age of complex applications is not a reliable means for creating a reusable and robust test scenarios, ESPECIALLY with regards to web applications.

    • nakshatra's avatar
      nakshatra
      Contributor

      Thanks for the reply.

       

      What ever i tried their is no dynamic properties. 

      what I understand is in my name mapping object so many 'panel' and 'cell' object are there.

      While running the script some times TC is not able to find the correct object. I tried for editing the properties for those objects. but i am not having properties to find uniquess. Every cell and panel having same properties.

      While recording we will think new object but internally it is mapping to existing object.

       

      Beacuse this also my test cases are getting failed.

      How can we make sure the uniqueness of the object?

       

       

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        By examining the properties of the object... This takes elbow-grease and work.  You need to go down the line of those panels and cells and make sure that any properties automatically mapped are enough... and if they are not, manually add them.  There is an "art" to this... and it does take time.  I cannot tell you EXACTLY what to do... because only you can see those properties and know what your application looks like.

         

        Again.... as noted... after recording, you should examine what was mapped and make changes.... and that means make changes the WHOLE WAY DOWN THE OBJECT TREE.  Because the error may not be on the TARGET object but on some ancestor.

         

        Some of us actually make a point that, before recording, map the objects manually first.  Take the time to build your mapping of your objects BEFORE you hit the record button.  The recording will then use the already-mapped objects instead of mapping new ones.... that is, so long as you did the job right.