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

Cannot select value from Kendo UI drop-down list

3 Answers 594 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mr
Top achievements
Rank 1
Mr asked on 21 Apr 2016, 03:32 PM
Hello,
I'm having issue selecting from Kendo UI drop-down list. It recorded well, but when I run the test, the mouse stopped at the drop-down without selecting the value from the drop-down. It works when the value I selected is visible from the drop-down (meaning I do not have to scroll-down), but when I select the value which needs to be scrolled down from the list, it is not working. I'm trying to select project name '30' which is not visible in the drop-down (see attached screen shot). 
I'm running test in IE. The test scripts are:
1. Click 'Span'
2. Wait for '6000' msec
3. Desktop command: HoverOver on StaticProjectSelectorListboxUnorderedList
4. Wait for 3000 msec
5. KendoListBox: select item by text '30'
6. wait for '3000' msec

It failed at step 5. I'm trying to find 'simulate real click option' from the test step which may resolve the issue, but I cannot find.

Please help.

3 Answers, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 26 Apr 2016, 11:02 AM
Hi Mr Robot,

Thank you for your interest in Telerik Test Studio. 

To be able to provide you the most proper solution in your scenario I will need further details Please collect your execution log and send it here archived. It would be also of great interest to get the failure details of the failing step. Here is a short video demonstration (no audio) on how to provide the appropriate information for investigation. 

Thank you in advance for the cooperation and I hope to hear from you soon. 

Regards,
Elena Tsvetkova
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Yan Jun
Top achievements
Rank 1
Iron
Veteran
answered on 16 Jul 2020, 04:14 AM

Hi,

Was looking for solution related to this post.

KendoListBox: select item by text 'xxxx' doesn't exactly manage to pass the test step with the following error message:

'16/07/2020 11:39:36 AM' - 'Pass' : 9. KendoInput: : Toggle Combo
'16/07/2020 11:39:39 AM' - 'Fail' : 10. KendoListBox: : select item by text 'Dec'
------------------------------------------------------------
Failure Information:
~~~~~~~~~~~~~~~
Refresh() failed due to an unexpected exception.
InnerException:
System.Exception: Refresh() failed due to an unexpected exception. ---> ArtOfTest.WebAii.Exceptions.FindException: Find Details:
- No FindParams defined.
- Start Element: [Element: 'html:0']
 
 
   at ArtOfTest.WebAii.ObjectModel.Element.Refresh()
   --- End of inner exception stack trace ---
   at ArtOfTest.WebAii.ObjectModel.Element.Refresh()
   at ArtOfTest.WebAii.ObjectModel.Element.Refresh(Boolean forceDomTreeRefresh)
   at ArtOfTest.WebAii.Controls.Control.Refresh()
   at Telerik.TestingFramework.Controls.KendoUI.KendoListBox.SelectItem(String text)
   at Telerik.TestStudio.Translators.KendoUI.ListBox.KendoListBoxSelectItem.Execute(Browser browser)
   at ArtOfTest.WebAii.Design.Extensibility.HtmlActionDescriptor.Execute(IAutomationHost autoHost)
   at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)

 

Then I proceed to just click on the item directly instead. My test steps are exactly like what this post describes, I toggle the Kendo Combo, wait for the item to exist and eventually click on the item.

The tool manages to do so, but as I watch the execution, the clicking was out of the drop down list at somewhere random.

Of course the item is selected correctly, but I don't think this is a very stable way to do it. It could randomly click on other things.

Is there a way I can set to scroll the item in Kendo Drop Down to visible and see that the tool able to click exactly on the item?

Thank you.

Regards,

Yan Jun

0
Elena
Telerik team
answered on 20 Jul 2020, 09:38 AM

Hi Yan,

I reviewed the shared details and first thing to mention is that the error you get on the KendoListBox step is not expected. Since a colleague of yours posted it in a support thread, we can focus on its investigation in the private ticket. 

In regards the currently used approach - to toggle the dropdown and select one of the items using a click step, this is also a valid approach to automate a dropdown and this depends on the exact control used in the application. Test Studio has built-in translators for almost all Telerik controls and thus, there are steps like the KendoListBox one, which allows you to use the options of the control itself. The exception you get when executing this step will be further investigated as mentioned above. 

In the case when such translator is not available you can use the approach to directly click on an item from the dropdown once it is toggled. How reliable this will be Depends on the find expression of the element, which is the item from the dropdown - if it uses something unique for the element, it will be consistently executed. 

I also watched the shared video of the test run and I suppose you refer the selection of the item with value 'Dec' in the second dropdown, which is not actually visible on the screen. This is why the annotation seems to be outside of the page, though it should target the element in the dropdown if the find expression is using the item's text content for example. 

Anyways, you can try to add a Scroll step from the elements quick menu in recording mode, but if this will work depends again on the exact control used in the application and its behavior. And since you are autimating an application built with the Telerik controls, it will be best if you use the translators. Therefore, I will suggest we focus on the translator's step and why this is not working as expected. 

Thank you for your understanding in advance.

Regards,
Elena
Progress Telerik

Tags
General Discussions
Asked by
Mr
Top achievements
Rank 1
Answers by
Elena
Telerik team
Yan Jun
Top achievements
Rank 1
Iron
Veteran
Share this question
or