Forum Discussion

sree2011's avatar
sree2011
Contributor
5 years ago
Solved

Object Identification Issue

I have created multiple automation scripts suites for a WPF application using Test Complete 12.41 version. All the suites run perfectly in my machine and all the machines in my environment. When we try to execute the same scripts in the client environment, all the suites except one suite will not run properly. The suite which is having issue will run properly for some time (probably 5 - 10 minutes) and after some time, it is not able to identify the objects properly and most of the steps are getting failed due to this. Client enviornment uses Virtual Machines for script execution. Could you please suggest on what could be the reason for the same.

  • Hi sree2011 

     

    In the majority of instances, the problems are related to object recognition issues.  Either because the object you are looking for by name doesn't exist due to, say, a mapped object's mapping properties not matching up to the actual value on the page, the object isn't ready, or, although it is mapped correctly, the object isn't actually there yet.  This is something quite common in Async/AJAX environments.  TC can't distinguish that the object isn't ready yet, just that it can't find it.

     

    It is possible that because of the speed the tests run at on you machine is quicker - perhaps because it's running on a local versus remote machine - the control is ready on your machine in the alloted time, but not on your remote machine.

     

    A few general strategies:

    • Add a Delay() in before you try and get the object.  I'm personally not a big fan of putting in Delays unless completely neccessary - rather use WAIT methods.
    • Increase your auto-wait timeout ([current/default] Project->properties->playback).  If TC finds the object before the Auto-wait timeout it continues, so setting this high won't affect your test speeds unless it genuinely can't find objects - at which point you may want to investigate why you have the issues in the first place
    • Before trying to use object.WAITxxx first do an existence check ( object.Exists) and only continue if it returns true
    • If it doesn't exists, you may want to consider waiting for a short while for your application to finish up then do a RefreshMapping() and/or RefreshMappingInfo() of your object's parent and try finding the original object again

7 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    It would be helpful to see the error messages that are coming up, specifically the Additional Info tab.  Also, anything you can give us on how the objects are mapped/identified.

    • sree2011's avatar
      sree2011
      Contributor

      Hi Robert Martin,

       

      Thank you for you reply. I have attached two mht file here which will provide you with more details. the file which is named as "tcResults1_Error" is the log file generated from the machine where it got issue. The other file is from my machine where it works fine. Please let me know if this help you in any way. We are using descripting programming and directly accessing the objects through code and there is no mapping done.

       

      Thanks & Regards,

      Sreekanth