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

Problem locating dropdown

8 Answers 80 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Iliya
Top achievements
Rank 1
Iliya asked on 14 Dec 2017, 07:14 AM

Hello everyone,

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.

 

Best reagrds,

Iliya I.

 

8 Answers, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 18 Dec 2017, 01:33 PM
Hello Iliya,

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! 

Regards,
Elena Tsvetkova
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Iliya
Top achievements
Rank 1
answered on 14 Feb 2018, 08:45 PM

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.

 Thanks

0
Elena
Telerik team
answered on 16 Feb 2018, 09:37 AM
Hi Iliya,

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? 

Thanks! 

Regards,
Elena Tsvetkova
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Iliya
Top achievements
Rank 1
answered on 16 Feb 2018, 11:58 AM

Hello Elena,

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?

 

Regards,

Iliya

0
Elena
Telerik team
answered on 16 Feb 2018, 03:21 PM
Hi Iliya,

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. 

Thanks! 

Regards,
Elena Tsvetkova
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Iliya
Top achievements
Rank 1
answered on 17 Feb 2018, 07:21 AM

Hello Elena,

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");
manager.ActiveBrowser.Actions.SetText(newBusinessName, "fsdfsfsdfsdf");

When I changed the element to KendoInput it is returned as null.

I hope you are able to understand my explanation.

Regards,

Iliya

0
Nikolay Petrov
Telerik team
answered on 21 Feb 2018, 03:48 PM
Hi Iliya,

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.

Best Regards,
Nikolay Petrov
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio
 
0
Iliya
Top achievements
Rank 1
answered on 24 Feb 2018, 08:01 AM
Thanks both! Very helpful.
Tags
General Discussions
Asked by
Iliya
Top achievements
Rank 1
Answers by
Elena
Telerik team
Iliya
Top achievements
Rank 1
Nikolay Petrov
Telerik team
Share this question
or