RadDropDownButton Click does not work

2 posts, 0 answers
  1. Evgeniy
    Evgeniy avatar
    8 posts
    Member since:
    Mar 2015

    Posted 26 Mar 2015 Link to this post

    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?
  2. Peshito
    Admin
    Peshito avatar
    497 posts

    Posted 27 Mar 2015 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top