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

Code to click on Kendomenuitem doesnt work

1 Answer 44 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Roger
Top achievements
Rank 1
Roger asked on 15 Mar 2016, 02:57 PM

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

 

1 Answer, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 18 Mar 2016, 09:26 AM
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!
Tags
General Discussions
Asked by
Roger
Top achievements
Rank 1
Answers by
Ivaylo
Telerik team
Share this question
or