开发者

CSS selector works in Firefox but not in IE

Does anyone know why this CSS selector works in Firefox but not in IE7 or IE8?

css=div[style~='visible;'] div[class~='x-combo-list-item']:contains('Test Job')

I'm using this in a Selenium test to find an element on the page.

Edit: The :contains selector is not the problem. I'm using it 开发者_运维知识库elsewhere in my tests and it works in IE6, 7, and 8.


I know that Selenium attempts to support all of CSS3 for all browsers in it's selector engine. It may be that it does not support multiple levels of the attribute selectors in IE.

You might be stuck with an XPath "locator" this one

Alternatively, you could try:

div[style~='visible'] .x-combo-list-item:contains('Test Job')


Probably because the :contains pseduo-class is a CSS3 addition and whatever version of IE you're using (you didn't specify) probably doesn't support :contains.

http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#selectors

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜