Microsoft Ribbon for WPF

8 posts, 0 answers
  1. Stanislav
    Stanislav avatar
    1 posts
    Member since:
    May 2012

    Posted 02 Nov 2012 Link to this post

    Hello all,

    Is there any possibility to automate Microsoft Ribbon for WPF control using Telerik testing framework?
    Link: http://www.microsoft.com/en-us/download/details.aspx?id=11877

    Thank you.

    Kind Regards,
    Stanislav Hordiyenko
  2. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 07 Nov 2012 Link to this post

    Hi Stanislav,

    Yes our Telerik testing framework can be used to automate the Microsoft Ribbon for WPF control. It won't recognize it as the complex Microsoft Ribbon for WPF control, but will recognize the individual WPF elements (text blocks, buttons, etc.) that are used to make up the complex controls.

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

    Posted 07 Nov 2012 Link to this post

    Hello Cody,

    Thank you for your answer. This is what I have been doing these days on a lower level of test automation. I would like to ask you whether it possible to write my own translators for custom WPF controls? If yes, where I can find information how to do this?

    The last time I wrote a simple wrapper for the RadBusyIndicator control:

    public class RadBusyIndicator : WpfTestElement
    {
        private static AutomationProperty isBusy = new AutomationProperty("IsBusy", typeof(bool));
        private static AutomationProperty progressValue = new AutomationProperty("ProgressValue", typeof(double));
        private static AutomationProperty isBusyIndicationVisible = new AutomationProperty("IsBusyIndicationVisible", typeof(bool));
        private static AutomationProperty isVisible = new AutomationProperty("IsVisible", typeof(bool));
     
        public bool IsBusy
        {
            get
            {
                return (bool)this.GetProperty(isBusy);
            }
        }
     
        public double ProgressValue
        {
            get
            {
                return (double)this.GetProperty(progressValue);
            }
        }
    }

    But I am looking for some manual to write more complex wrappers.

    I look forward to hearing from you.

    Kind Regards,
    Stanislav Hordiyenko
  4. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 11 Nov 2012 Link to this post

    Hi Stanislav,

    I would like to ask you whether it possible to write my own translators for custom WPF controls?

    Writing a translator that works like our other translators that come with Test Studio is not an easy task plus we haven't published the API interface you would need to do so. Instead I suggest you look into writing your own "wrapper class" i.e. an independent class that you can instantiate in code and use the methods in it you define.

    But I am looking for some manual to write more complex wrappers.

    You code sample looks like a good base start. I am sorry but we don't have any such manual. We'll be glad to help when you get stuck on a specific area/function.

    All the best,
    Cody
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  5. Stanislav
    Stanislav avatar
    1 posts
    Member since:
    May 2012

    Posted 20 Nov 2012 Link to this post

    Hello Cody,

    The name of the wrapper class should be the same as XAML tag name (e.g. RadBusyIndicator class has the same name as its xaml tag element) of the element in the application? Is it possible to specify somehow the XamlTag of the search element in WPF application? I have faced with an issue when there is already a wrapper with the same name in your library.

    Thank you in advance.

    Kind Regards,
    Stanislav Hordiyenko
  6. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 20 Nov 2012 Link to this post

    Hello,

    The name of the wrapper class should be the same as XAML tag name

    Why? There's no technical reason you must do this. Perhaps for naming convention only it makes sense. Just don't put it into the same name space as ours i.e. don't put your RadBusyIndicator in Telerik.WebAii.Controls.Xaml.

    Is it possible to specify somehow the XamlTag of the search element in WPF application?

    To search by XamlTag use something like the following:

    ActiveBrowser.SilverlightApps()[0].Find.ByExpression(new XamlFindExpression("XamlTag=gridviewvirtualizingpanel", "automationid=PART_GridViewVirtualizingPanel"));


    Regards,
    Cody
    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 20 Nov 2012 Link to this post

    Hello Cody,

    I think I was not clear in my question. When I try just to find the first RadBusyIndicator in the WPF application, and the wrapper class is not the same as XamlTag, then it couldn't be found. Once I rename the class name to RadBusyIndicator, the code returns me the first element.

    .Find.ByType<RadBusyBusyIndicator>() //returns nothing
    .Find.ByType<RadBusyIndicator>() // returns the first element that was found in the form

    So, my question was is it possible to name the wrapper class in unique way and specify in the class which XamlTag should be used while searching the element in the form.

    I look forward to hearing from you.

    Kind Regards,
    Stanislav Hordiyenko
  8. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 21 Nov 2012 Link to this post

    Hello Stanislav,

    If what you're trying to do is replace our own RadBusyIndicator class, I think you'd be better off adding an Extension method to the existing class instead.

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