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
7 Answers, 1 is accepted
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
Test Studio Trainings
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
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.
Cody
the Telerik team
Test Studio Trainings
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
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
Test Studio Trainings
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
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
Test Studio Trainings