Code to click on Kendomenuitem doesnt work

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

    Posted 15 Mar 2016 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





  2. Ivaylo
    Ivaylo avatar
    782 posts

    Posted 18 Mar 2016 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.

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