Code to click on Kendomenuitem doesnt work

2 posts, 0 answers
  1. SHK
    SHK avatar
    11 posts
    Member since:
    Jul 2015

    Posted 15 Mar Link to this post

    Hi ,

    I have an element with following properties

    Name= TestMenuMnActiveListItem  (element added by highlighting and using option Add to Elements)     

    ControlType = Telerik.TestingFrameworks.Controls.KendoUI.KendoMenuite

    Expression : "data-role=menu,|,TagName=li,InnerText=^Sales,class=k-item k-state-default rootMenuItem"

    When I run the recorded step  'Click  TestMenuMnActiveListItem' it works ok. 

    But I want to find this element through code and then click it so as to be able to make a reusable test for multiple menu items.

    I used the below code but it doesn't recognize the element. Can you please help me in fixing this.

    Dim MenuExpr as New HtmlFindExpression("data-role=menu","|","TagName=li","InnerText=^Sales","class=k-item k-state-default rootMenuItem")                                         
      
    Dim MenuItem as KendoMenuItem = Pages.HttpsWwwRambase1.Find.ByExpression(of KendoMenuItem)(MenuExpr )
      
    MenuItem .Click

     

    Thanks,

    Sprithi

     

  2. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 18 Mar Link to this post

    Hеllo Sprithi,

    The code looks correct and you should not have problems clicking on the item. In order to investigate this we will need your test and access to the tested application.

    As a workaround you can use recorded step and use it in multiple tests within the same project.

    Regards,
    Ivaylo
    Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top