New to Telerik Test Studio? Download free 30-day trial

Verify Silverlight ComboBox Contains Specific Text

I would like to iterate through a Silverlight ComboBox and verify that it contains specific text strings.

Solution

Here is the sample code to achieve that.

ComboBox cb = Pages.SilverlightToolkitSamples.SilverlightApp.Item0Combobox; 
bool found = cb.TextBlockContent.Contains(Data["Col1"].ToString()); 
 
Log.WriteLine("Match found: " + found.ToString()); 
Assert.IsTrue(found); 
Dim cb As ComboBox = Pages.SilverlightToolkitSamples.SilverlightApp.Item0Combobox 
Dim found As Boolean = cb.TextBlockContent.Contains(Data("Col1").ToString()) 
 
Log.WriteLine("Match found: " + found.ToString()) 
Assert.IsTrue(found) 
In this article