Hello Travis Acton,
Oh, this is for a Silverlight application. I apologize I did not know that. I (incorrectly) assumed you were working with a straight HTML page.
Detecting the color of text in a Silverlight app is much more complicated because Silverlight supports the use of brush objects for painting text in simple or complex brush and color gradients. The text is drawn using a brush which is set via the "Foreground" property. Verifying color still can be done but requires resorting to custom code. If we assume the brush is a solid color brush we can get the brush and verify the color of the brush being used to paint the text block. Here is sample code to do this:
"Verify textblock color is 255, 105, 72, 40"
, RequiresSilverlight =
Brush textblockBrush = (Brush)Pages.TelerikTreeViewFor.SilverlightApp.InstallerTextblock.GetProperty(
Color actualColor = ((SolidColorBrush)textblockBrush).Color;
"Error: alpha color does not match expected."
"Error: red color does not match expected."
"Error: green color does not match expected."
"Error: blue color does not match expected."
// If it's not a SolidColorBrush what is it? How do we handle it?
I've attached a complete sample test that runs against our Silverlight demo page to demonstrate this more completely.
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