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

How to find number of items returned by a AutoCompleteBox

2 Answers 61 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Lim
Top achievements
Rank 1
Lim asked on 01 Sep 2010, 02:31 PM
I am using a AutoCompleteBox in my Silverlight app but I can't work out how to get the number of options listed by the AutoCompleteBox because I can't cast the control to AutoCompleteBox because it can't be converted to a WebAii FrameworkElement.

Any ideas?  My code looks something like this.  

var autoCompleteBox = app.FindName(testUtil.AutoCompleteBox);
autoCompleteBox.User.TypeText("f", 50);
 
autoCompleteBox.Refresh();
 
var list = (List<String>) autoCompleteBox.As<AutoCompleteBox>().ItemsSource;
 
Assert.That(list.Count, Is.EqualTo(2));

2 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 08 Sep 2010, 12:09 PM
Hello Lim,

First I'm sorry for the delay in our response. We are overloaded with WebUI Test Studio support which takes higher priority. We won't leave WebAii tickets unanswered as well though.

I used the Visual Tree Explorer coming built-in with WebUI Test Studio to explore the AutoCompleteBox structure. As you can see in the attached image the control presents the items in a ListBox. This means you can use the WebAii ListBox wrapper to locate and check its items as well. I hope this helps!

All the best,
Konstantin Petkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Lim
Top achievements
Rank 1
answered on 08 Sep 2010, 12:12 PM
Thanks for that.  I actually worked it out already :)
Tags
General Discussions
Asked by
Lim
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Lim
Top achievements
Rank 1
Share this question
or