This is a migrated thread and some comments may be shown as answers.

RadDropDownButton Click does not work

1 Answer 202 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Evgeniy
Top achievements
Rank 1
Evgeniy asked on 26 Mar 2015, 09:46 AM
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?

1 Answer, 1 is accepted

Sort by
0
Peshito
Telerik team
answered on 27 Mar 2015, 09:05 AM
Hi Evgeniy,

Thank you for your question.

Please find my answer in the other forum thread you have started.

I am posting a reference link below so others can find it.
http://www.telerik.com/forums/raddropdownbutton-user-click-does-not-work-ac1c09d1383c


Regards,
Peshito
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
General Discussions
Asked by
Evgeniy
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Share this question
or