Forum Discussion

challach's avatar
challach
New Contributor
14 years ago

Missing Created Object References in IE

Hello All,



I am working on TestComplete 8.2, for a web-based application testing. I have to test the functionality in IE and Firefox browsers.

At present I am facing an issue with the objects I created while executing them in IE - an example is below.



I created an object, say objItem at line 3, and I worked on that.

From lines 4 thru 12 I did some other validations, and some refresh things (clicking on a button and validate some other things)

[Please note that there were some page refresh things happend from line 4 - 12] 



Again I want to use the same object created in line 3 (objItem) now in line 13 - where in IE, it says does not exist.

And in Firefox it is working fine.



I faced similar kind of issues with the objects in QTP and I got the solution by using  objItem.init before acting something on that object.

Please let me know if anybody has faced similar kind of issues and found a solution for that.



Thank you.

Chandra.

4 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    If the object was an object from within the application, if you did page navigations where during the course of your automation the actual component in your application was destroyed and recreated, your "handle" the object is no longer valid.  You will most likely need to reassign it.



    You can get around this, BTW, by using Aliases and NameMapping for your object references.  Each explict call to Aliases.MyApp.MyObject automatially refreshes and reassigns the object based upon what is current in the application.

  • Hi Chandra,





    Robert is right. In addition, you can try calling the Refresh or RefreshMappingInfo methods (depending on whether you use Name Mapping) just in case, to force TestComplete notice the latest changes in your application.


  • challach's avatar
    challach
    New Contributor


    Thank you for your reply.



    I am not using the Namemapping though.

    Creating the objects using FindChild Methods.



    So how to resolve the issue. Could you give an example please.



    Thank you.

    Chandra
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Either you need to redo the "FindChild" call to reassign your object or you need to call the Refresh method on the object.



    Either way, it comes down to the object you originally assigned no longer exists so you need to reassign it in some way or tell TestComplete to refresh it.



    In truth, NameMapping/Aliases are probably the best way to go.  Failing that, I'd simply redo the "FindChild" on the next call to your objitem.