I am really new to Telerik Testing Framework and I found my first kind of a blocker. I need to locate a dropdown.
The HTMl is attached.
The following attempts are not successful:
RadDropDownList typeDropdown = manager.ActiveBrowser.Find.ByContent<RadDropDownList>("l:One off");
HtmlSelect typeDropdown = manager.ActiveBrowser.Find.ByContent<HtmlSelect>("l:One off");
When I try to locate it as a simple element and to click on it is OK:
var typeDropdown = manager.ActiveBrowser.Find.ByContent("l:One off"");
I am really sorry if my question is not clear or is on the wrong place.
8 Answers, 1 is accepted
Thank you for reaching us out.
As per the shared html it seems that the dropdown is actually the span right under the parent div - the one with class k-widget k-dropdown k-header full-width. You would need to locate it and cast it as a Kendo input since the Kendo dropdown is a type of Kendo input.
To access the elements in the list when the dropdown is opened you would need to first trigger opening the dropdown list, then locating the element you would need to select as per the scenario.
I hope this will be helpful to you!
Thanks a lot. It works for me.
The next problem I faced is locating and handling a multiselect drop down. I am wandering to what type to cast.
To be able to provide any advice I will need your page or the DOM tree of it. Could you please provide the page or its html code for the element you have difficulties with?
I succeeded with handling the multiselect.
Now I face very strange problem. As you can check the attached HTML file I successfully locate each elements in the grid row. All desired text is filled in them and the confirm button is clicked successfully.
But the app throws error message that the grid cells are empty which is very odd because I can see the desired inputted text in them.
How can I handle it?
Thanks for the feedback.
I am not familiar with the code you had applied. But as of the description of the current behavior I suspect that you need to either simulate real user behavior (which will trigger the JS events for that elements) or add code to trigger these explicitly.
To simulate real user you probably would need to use the Keobard Manager TypeText Method.
Please give these a try and consider sharing your application and a sample code which you have troubles with in case further assistance will be required.
I found the desired row from the table as HtmlInputControl which does not have a method TypeText.
var newBusinessName = manager.ActiveBrowser.Find.ByExpression<HtmlInputControl>("tagname=input", "name=Name", "class=k-input k-textbox");
When I changed the element to KendoInput it is returned as null.
I hope you are able to understand my explanation.
If you need to work with the "KendoInput" wrapper it will be necessary to locate the outermost "span" element that contains the "k-widget" class.
Please, refer to the attached screenshot for clarification.