Can't select ComboBox Item

3 posts, 0 answers
  1. Artem
    Artem avatar
    25 posts
    Member since:
    Jul 2010

    Posted 19 May 2011 Link to this post


    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. Artem
    Artem avatar
    25 posts
    Member since:
    Jul 2010

    Posted 23 May 2011 Link to this post

    Any ideas?
  3. Boyan
    Boyan avatar
    758 posts

    Posted 24 May 2011 Link to this post

    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.
    var g = Pages.SilverlightApplication.SilverlightApp.Item0Combobox.Items;
    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,
    the Telerik team

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

Back to Top