Check for color


#1

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??


#2

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?


#3

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.


#4

I guess my next question would be:

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


#5

On Mon, Nov 3, 2008 at 11:16 AM, Bob S.
removed_email_address@domain.invalid wrote:

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.

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!

Hassan S. ------------------------ removed_email_address@domain.invalid


#6

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