This is a migrated thread and some comments may be shown as answers.

ActiveBrowser.RefreshDOMTree vs [objectName].Refresh

2 Answers 97 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Paulo
Top achievements
Rank 2
Paulo asked on 03 Feb 2014, 05:04 PM
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 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 06 Feb 2014, 06:43 PM
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!
0
Paulo
Top achievements
Rank 2
answered on 07 Feb 2014, 02:38 PM
Hi Cody,

Thanks for the explanation.

Regards,
Paulo
Tags
General Discussions
Asked by
Paulo
Top achievements
Rank 2
Answers by
Cody
Telerik team
Paulo
Top achievements
Rank 2
Share this question
or