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

How to deal waiting Silverlight element?

1 Answer 77 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Seff
Top achievements
Rank 1
Seff asked on 31 Jan 2013, 09:25 AM
Hi Telerik,

We have created some test cases in test studio. And we are using "Wait for" steps added by "Execution Delay" menu to wait user login or some elements is ready to input. Because during the record/replay, Busy Indicator(Silverlight) is working and these elements can not be operated.

We used this simple way as a resolution but we met following issue caused failed,

1. server performance which will be affected by other programs may enlarge the loading time for the web page elements.
2. switch to different environment/server may also enlarge the waiting time

To avoid the tests failed by the Wait for not enough, do you have any suggestion or better solution?

I searched the forums and try to use some "Wait for Exists" or "Wait for visibility visible" to handle this issue. but the test still failed.

Thanks for your reading and hope there will be a easy way to solve this.

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 31 Jan 2013, 09:50 AM
Hi Seff,

Please see this article on that topic. You can use the same approach for Silverlight applications. Here's a short video demonstrating how this works.

You can also do that with a coded step:
IList<FrameworkElement> indicators = ActiveBrowser.SilverlightApps()[0].Find.AllByType("BusyIndicator");
foreach (var indicator in indicators)
{
    Wait.For<FrameworkElement>((a_) => ((bool)a_.GetProperty(new AutomationProperty("IsBusy", typeof(bool))) == false), indicator, 20000);
}


Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Seff
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or