开发者

How can I programatically test which CSS elements match my XHTML?

开发者 https://www.devze.com 2023-01-01 12:08 出处:网络
I have an application which gene开发者_开发问答rates XHTML documents which are styled with (mostly) static CSS. I\'m currently using XPath and Hamcrest (Java) to verify that the documents are construc

I have an application which gene开发者_开发问答rates XHTML documents which are styled with (mostly) static CSS. I'm currently using XPath and Hamcrest (Java) to verify that the documents are constructed correctly. However, I also need to verify that the correct CSS properties are matched. For example, I would like a test like this:

Given XHTML element Foo, verify that the property "text-transform:uppercase" is applied.

Ideally, I would like a Java framework that provides this. I've looked a bit at Selenium, but I don't see this type of functionality. Thanks ...


You can do this in Javascript, using the getStyle() code as described on quirksmode.


You can use Windmill to do this for you very easily. It is not a java framework, but it will work on any webapps, and IMO it is better than Selenium.

0

精彩评论

暂无评论...
验证码 换一张
取 消