ActiveBrowser.RefreshDOMTree vs [objectName].Refresh

3 posts, 0 answers
  1. Paulo
    Paulo avatar
    12 posts
    Member since:
    Jun 2013

    Posted 03 Feb 2014 Link to this post

    Hi,

    I´m testing a silverlight application.

    I have to expand a tree, and used ActiveBrowser.RefreshDomTree();, but it didn't work.
    So, I've added [objectName]..Refresh();, that didn't work as well...

    The only way to put this working was adding, before these "refreshes", a System.Threading.Thread.Sleep(500);.

    So... my question is:

    1. what's the main difference between ActiveBrowser.RefreshDomTree(); and [objectName]..Refresh(); ?
    2. what kind of implications in these "refreshes", System.Threading.Thread.Sleep(500); have?


    Best regards,

    Paulo
  2. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 06 Feb 2014 Link to this post

    Hi Paulo,

    what's the main difference between ActiveBrowser.RefreshDomTree(); and [objectName]..Refresh(); ?

    In the context of a Silverlight element, the difference is huge. RefreshDomTree will only refresh the cached HTML portion of the DOM within our ActiveBrowser object. The Sidelight VisualTree and any elements referenced will not get refreshed.

    [objectName].Refresh() will update the properties of that element object using whatever is currently in the local memory cache of the ActiveBrowser object.

    To refresh the VisualTree of a Silverlight application requires code like this:
    SilverlightApp slapp = ActiveBrowser.SilverlightApps()[0];
    slapp.RefreshVisualTrees();


    Regards,
    Cody
    Telerik
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  3. Paulo
    Paulo avatar
    12 posts
    Member since:
    Jun 2013

    Posted 07 Feb 2014 in reply to Cody Link to this post

    Hi Cody,

    Thanks for the explanation.

    Regards,
    Paulo
Back to Top