Forum Discussion

varun_masuraha's avatar
varun_masuraha
Contributor
10 years ago

Object hierarchy not refreshed in "FindAll/FindAllChildren" methods

Hey,

 

I observed that when I call query methods like "Find()/FindChild()", the object hierarchy does get refreshed.

But when I use methods like FindAll()/FindAllChildren() to query multiple results, the object hierarchy does NOT get refreshed, even after explicity passing 'true' in last function parameter.

As a workaround I have to call "browserPage.Refresh()" seperately.

 

I'm using version 11.11.1064.7 on Java based web Application.

 

Could someone comment if having similar issue ?

 

regards,

Varun

  • jack_edwards's avatar
    jack_edwards
    Occasional Contributor

    According to the documentation, the object hierarchy is only expected to refresh when no objects are found matching your criteria.  If even one object is found, then the hierarchy does not get refreshed and you are stuck with the results from your cached version of the page.

     

    At least that's what the documentation says.  I have no idea what is actually happening behind the scenes.

     

     

    http://support.smartbear.com/viewarticle/71244/

     

    Refresh

    TestComplete performs the search in the cached copy of the object hierarchy, which may not correspond to the actual hierarchy of objects in the tested application. This may happen, for instance, if the actions that precede the search caused changes in the application state. The Refresh parameter lets you specify what TestComplete should do if no objects matching the search criteria were found in the cached object tree. If it is True (default), TestComplete will refresh the cached object tree and perform the search once again. If it is False, TestComplete will not refresh the object tree and will return an empty array indicating that no objects were found.

    • varun_masuraha's avatar
      varun_masuraha
      Contributor

      Hi Jack,

       

      (Sorry for late response.)

      Thanks for highlighting that. I had missed the fine print in details.

      But it would have been much better if the cache was refreshed even if objects are found.

      Wonder why they impletemented this way, might be due to performance concerns.

       

      regards,

      Varun