Forum Discussion

JavierCollRodri's avatar
JavierCollRodri
Contributor
15 years ago

jQuery objects multiplicated on Object Browser

Hello,



I've got a problem when automating a web page with jQuery.



The application lists a series of elements via jQuery. Every time any element gets listed, I destroy the previously created lists and dialogs associated, so there is no duplication in the web page.



But every time an element is listed, Test Complete stores new panels in the Object Browser instead of replacing the values, so after updating a list 3 times (for example) there are 3 panels with the same name plus a counter (for example, "main_1", "main_3" and so on, where "main" is the object ID), filled with the same information (so there is an object with id "side" inside "main_1", "main_3"... - no counter is added, if you understand me)



The major problem of that issue is that after listing ten times some elements and searching for a nonexistent object (a previously deleted element, for example), the search takes much time to finish (some times it took me 10 minutes, and I had to stop the execution!)



To solve it I have used the property "VisibleOnScreen" in my searches, but it's not efficient, so maybe an object is not visible on screen every time (for example, when the list exceeds the screen)



So my question is, has anyone seen this before? Is there a way to avoid panel multiplication or to reload the Object Browser, so nonexistent panels get deleted?



Thank you very much!

9 Replies

  • I have been searching for information about this problem, and I found this:



    In this link (TestComplete 8.10 bugfixes) SmartBear talks about "Objects duplication" bug in firefox that has been solved. So I tested the same scenario in IE and it does not happen, it's only a Firefox problem.



    So maybe it is a TestComplete bug. Can anyone confirm this?



    Thank you very much, once again!
  • I have been using TC 8.50 until today, that I have updated to version 8.60.



    But it happened also in TC 8.50, it didn't start when I updated the software.



    Thanks for answering!
  • Hi Javier,



    Have you tried calling the Refresh() method for the parent of duplicated objects?

    If this doesn't help, we will need to examine the problematic web page for further investigations. You may either provide the link in this thread, or submit it via our Contact Support form.
  • Yes, I have tried it, and with no results.



    This web page is not accessible from the outside, it's an internal web page, so I'm trying to recreate it in a smaller webpage and send you the files. I don't know how much time it will take; by now I am not able to reproduce it.



    Thanks!



    -

    Well, I did it!



    I think this issue is related to panels idStr or loading files with a certain name via ajax. I send you in a zip file a little web page that reproduces the bug. There you can find the how to reproduce.



    I hope it helps!
  • Hello Javier,

    Thank you. I have reproduced the object multiplication issue with the page you sent. We will investigate this issue and inform you of the results.

    Sorry for the inconvenience.
  • Hello again,

    The issue will be fixed in one of future updates. Thank you for the sample that helped to spot it.

    Meanwhile, you can work it around by enclosing the updatable div (the one having id=main) into another div element:



    <div>

      <div id='main'>

         ...

      </div>

    </div>



    or wrapping the entire body into the div element:



    <body>

     <div>

       ....

     </div>

    </body>

  • Hello Artem,



    Thank you for your time, and for the work around; it is enough to fix the problem. I'm glad I helped by spotting the bug and I hope this thread helps others until the bug is fixed.



    Bye!