Check for color

Does anyone know how to check to make sure that the text on a screen is a certain color.

What I wish to do is check to make sure that the text color is red.

Any ideas??

Can you give us more information about the goal? I'd think you could do a visual check of the page, or do some direct styling.

I haven't tried, but perhaps you can walk the DOM and check for styling?

I am trying to create an auto test that will check some values on a page and then also make sure that the text on some of the entries is in red and other text in black. The text on the page will always be different so I don't think checking all the HTML is the way to go.

I guess my next question would be:

Are you generating this page yourself or are you reading a page from somewhere else?

This page is from an internal website for my company, so no I am not generating it myself.

Text is just character strings -- it doesn't have "colors" :slight_smile:

A User Agent /may/ display text with colors provided through style sheets or style attributes in tags.

If you know in advance how the styling will be applied you might be able to use WebTest; otherwise I'd suggest looking at a UA-based tool like Selenium.

HTH!