# How do I test that external CSS does not contain an absolute URL via unit test?

I have been given the task of validating that we do not have any http:// URLs in our CSS or HTML documents. I've created a selenium IDE test that looks at src & href attributes as well as script tags for http: but I'm not sure how to test a style sheet.

As I'm not trying to test specific selectors, it could be in any attribute in the document. For instance, a random div tags background:

I've thought about putting this in java and attempting to pull resources and parse them, but that seems a bit over the top.

-
Welcome to SQA, Lucas. Do you need to worry about Javascript-induced changes, or is a static analysis good enough? –  user246 Dec 11 '12 at 17:50
JavaScript would be nice to have, but not necessary. –  Lucas Holt Dec 11 '12 at 18:05
How about creating a simple script in bash/Perl that lists all occurences of such incorrect resources? e.g. cat *.css | grep 'http://'? –  dzieciou Dec 11 '12 at 18:07
Unfortunately, I don't have access to the flat files because they're a resource served as part of a custom CMS product for university giving. As users change the CSS, the URL to the CSS changes. Otherwise, that's a great idea. –  Lucas Holt Dec 11 '12 at 18:13