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

Can't select ComboBox Item

2 Answers 146 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Artem
Top achievements
Rank 1
Artem asked on 19 May 2011, 09:22 AM
Hello

I've  problems with several comboboxes in our project. It's not possible to use SelectItemByText because Items.Count of these comboboxes is 0 but we could see items in the application.
There are test application with one combobox and my test for this application attached.
Is there a way to select combobox item by text from this combobox?

2 Answers, 1 is accepted

Sort by
0
Artem
Top achievements
Rank 1
answered on 23 May 2011, 10:07 AM
Any ideas?
0
Boyan
Telerik team
answered on 24 May 2011, 03:56 PM
Hello Artem,

Thank you for the projects, they helped us a lot in pinpointing the problem. There was a problem in ComboBox  method SelectItemByText that I managed to fix and the fix will be included in the next internal build or in the service pack that will be released in a coupe of weeks.

Also you have to write another line of code if you wish your test to work. In order to be able to select an item you have to open the dropdown of ComboBox first. If the dropdown is not opened the items won't be found by the framework and the method will fail. Your code should look something like this.
ActiveBrowser.NavigateTo("http://localhost:9595/SilverlightApplicationTestPage.html");
var g = Pages.SilverlightApplication.SilverlightApp.Item0Combobox.Items;
Pages.SilverlightApplication.SilverlightApp.Item0Combobox.OpenDropDown(true);
Pages.SilverlightApplication.SilverlightApp.Item0Combobox.SelectItemByText(true, "Second");

Before the fix as a workaround you can use the method SelectItemByIndex as it will work as expected.

Hope this helps. I have also updated your Telerik points for the report.

Best wishes,
Boyan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
General Discussions
Asked by
Artem
Top achievements
Rank 1
Answers by
Artem
Top achievements
Rank 1
Boyan
Telerik team
Share this question
or