Find.AllByType<RadBusyIndicator>()?

7 posts, 0 answers
  1. Jon
    Jon avatar
    3 posts
    Member since:
    Jan 2011

    Posted 21 Nov 2011 Link to this post

    I'd like to use app.Find.AllByType<RadBusyIndicator>(). I know RadBusyIndicator is not a FrameworkElement. Is this possible?

    Let me know if you need more details. Thanks.
  2. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 24 Nov 2011 Link to this post

    Hello Jon,
    you'll have to use Find.AllByExpression(new XamlFindExpression("XamlTag=radbusyindicator")) instead. Blow is a code sample that demonstrates this approach against this demo page:
    http://demos.telerik.com/silverlight/#BusyIndicator/FirstLook

    You might have to add a System.Threading.Thread.Sleep() wait step after the navigateTo step. This is because it take a while for the entire DOM tree of the app to properly load.

    Settings.Current.Web.EnableSilverlight = true;
    // Launch a browser instance
    Manager.LaunchNewBrowser();
      
    // Navigate to the page
    ActiveBrowser.NavigateTo("http://demos.telerik.com/silverlight/#BusyIndicator/FirstLook");
     
    // Get an instance of our Silverlight app.
    SilverlightApp app = ActiveBrowser.SilverlightApps()[0];
      
    //Go through all the busyIndicators and write their string representation to the log
    foreach (FrameworkElement fe in app.Find.AllByExpression(new XamlFindExpression("XamlTag=radbusyindicator"))) {
       Log.WriteLine(fe.ToString());
    }


    All the best,
    Stoich
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. N1t1nA
    N1t1nA avatar
    37 posts
    Member since:
    Mar 2011

    Posted 20 Nov 2012 Link to this post

    Hi Support

    How should i typecast my framework Element as BusyIndicator as I want to use the Busy indicator property IsBusy in my framework for Verification

    My code is :
    var list = SilverlightApp.Find.AllByType("BusyIndicator");

    from this list obtained above, i want to fetch the busyindicator object to access the IsBusy property so that I can perform my logic based on this property.


    Regards
    Nitin



  4. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 22 Nov 2012 Link to this post

    Hi Jon,
    you can do it like this:
    FrameworkElement e = ActiveBrowser.SilverlightApps()[0].Find.AllByExpression(new XamlFindExpression("xamltag=RadBusyIndicator"))[0];
    RadBusyIndicator b = e.As<RadBusyIndicator>();

    The b variable will now of class RadBusyIndicator. I hope this help.

    All the best,
    Stoich
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  5. Rohit
    Rohit avatar
    10 posts
    Member since:
    Dec 2011

    Posted 23 Nov 2012 Link to this post

    Hi Stoich,

    In our Application we are using the System.Windows.Controls busy Indicator So we need to convert it into:-

    FrameworkElement e = ActiveBrowser.SilverlightApps()[0].Find.AllByExpression(new XamlFindExpression("xamltag=BusyIndicator "))[0];
    BusyIndicator b = e.As<BusyIndicator >();

    It is using the dll.
    using System.Windows.Controls;


    RadBusyIndicator we are not using so the solution you have provided is not useful for us.

    Any alternate or work around please provide.

    Please Reply fast Because it very Important to us

    Regards,
    Rohit Malhotra
  6. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 23 Nov 2012 Link to this post

    Hello Jon,
    I understand now.

    We have no wrapped for this control. This means you should try and get the intended property using GetProperty as seen here:
    http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/write-tests-in-code/silverlight-test-automation/invoking-actions.aspx

    The code will be something like this:
    FrameworkElement indic = app.FindName("airlineTicket");
    AutomationProperty busystatus = new AutomationProperty("isBusy", typeof(bool));
     
    bool iBusy= (bool)indic.GetProperty(busystatus);

    I hope this helps.

    Kind regards,
    Stoich
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  7. Stanislav
    Stanislav avatar
    1 posts
    Member since:
    May 2012

    Posted 26 Nov 2012 Link to this post

    Jon,

    You can develop your own wrappers for custom controls in the application. I have many custom controls in my product and I was forced to create all wrappers manually. Fortunately, Telerik testing framework provides such capabilities (the most flexible framework for WPF automation that I have ever seen).

    Let me know if you need any advice or a piece of code.

    Kind Regards,
    Stanislav Hordiyenko
Back to Top