Hello.
I was trying to make a simple UI-test (with NUnit framework), and my test needs to click on telerik RadDropDownButton on WPF window.
When I click on this button using mouse, it works fine (I can see 'RadContextMenu' with 'RadMenuItem' items), but when my test doing this, RadContextMenu does not appear.
Here is the part of Veiw.xaml file:
<telerik:RadDropDownButton x:Name="btnDrop" AutomationProperties.AutomationId="btnDropMenu">
<telerik:RadDropDownButton.DropDownContent>
<telerik:RadContextMenu BorderThickness="0">
<telerik:RadMenuItem Header="option1" Command="{StaticResource op1CommandReference}"/>
<telerik:RadMenuItem Header="option2" Command="{StaticResource op2CommandReference}"/>
<telerik:RadMenuItem Header="option3" Command="{StaticResource op3CommandReference}"/>
</telerik:RadContextMenu>
</telerik:RadDropDownButton.DropDownContent>
</telerik:RadDropDownButton>
This is my code:
var button = win.Find.ByName<Telerik.WebAii.Controls.Xaml.RadDropDownButton>("btnDrop");
button.User.Click();
There is no exception, test finds this button, but when I'm trying to find RadMenuItem, I get this exception (just because RadContextMenu does not appear):
ArtOfTest.Common.Exceptions.FindElementException : Element Not found!
How can I fix this?
I was trying to make a simple UI-test (with NUnit framework), and my test needs to click on telerik RadDropDownButton on WPF window.
When I click on this button using mouse, it works fine (I can see 'RadContextMenu' with 'RadMenuItem' items), but when my test doing this, RadContextMenu does not appear.
Here is the part of Veiw.xaml file:
<telerik:RadDropDownButton x:Name="btnDrop" AutomationProperties.AutomationId="btnDropMenu">
<telerik:RadDropDownButton.DropDownContent>
<telerik:RadContextMenu BorderThickness="0">
<telerik:RadMenuItem Header="option1" Command="{StaticResource op1CommandReference}"/>
<telerik:RadMenuItem Header="option2" Command="{StaticResource op2CommandReference}"/>
<telerik:RadMenuItem Header="option3" Command="{StaticResource op3CommandReference}"/>
</telerik:RadContextMenu>
</telerik:RadDropDownButton.DropDownContent>
</telerik:RadDropDownButton>
This is my code:
var button = win.Find.ByName<Telerik.WebAii.Controls.Xaml.RadDropDownButton>("btnDrop");
button.User.Click();
There is no exception, test finds this button, but when I'm trying to find RadMenuItem, I get this exception (just because RadContextMenu does not appear):
ArtOfTest.Common.Exceptions.FindElementException : Element Not found!
How can I fix this?