Validating Properties of Silverlight Elements

Of course the end goal of automated Silverlight testing is to verify the Silverlight application is responding properly. Telerik Testing Framework doesn't have any special Silverlight validation features built-in. However, given that you have full access to every possible property of every Silverlight element, you should have no problem implementing your own validation code. Here are just a few examples:

 

C#

Assert.IsTrue(guidanceOverlays.Count == 15);

Assert.IsTrue(CompareUtils.NumberCompareRange(foundPatients.Count, 93, 105, NumberRangeCompareType.InRange);

Assert.IsTrue(patientSearchItem.Find.ByName("Address").Visibility == Visibility.Collapsed);

Assert.IsTrue(searchScroll.VerticalOffset == 2000);

Assert.AreEqual<System.Drawing.Rectangle>(new System.Drawing.Rectangle(1700, 259, 813, 465), admin1.GetScreenRectangle());

 

 

Visual Basic

app.Find.Strategy = FindStrategy.WhenNotVisibleReturnElementProxy

Assert.IsTrue(CompareUtils.NumberCompareRange(foundPatients.Count, 93, 105, NumberRangeCompareType.InRange))

Assert.IsTrue(patientSearchItem.Find.ByName("Address").Visibility = Visibility.Collapsed)

Assert.AreEqual(2000, searchScroll.VerticalOffset)

Assert.AreEqual(Of System.Drawing.Rectangle)(New System.Drawing.Rectangle(1700, 259, 813, 465), admin1.GetScreenRectangle())