How to deal waiting Silverlight element?

2 posts, 0 answers
  1. Seff
    Seff avatar
    9 posts
    Member since:
    Aug 2012

    Posted 31 Jan 2013 Link to this post

    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.

  2. Plamen
    Plamen avatar
    8 posts

    Posted 31 Jan 2013 Link to this post

    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);

    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top